num+1 increments the number before the current expression is evaluted so log will be the number after increment, but num++ increments the number after the expression is evaluated, so log will log the num before increment then increment it.
if you like to do the same functionality as num+1 you may use ++num and it will do the same.
They both increment the number. ++i is equivalent to i = i + 1.
i++ and ++i are very similar but not exactly the same. Both increment
the number, but ++i increments the number before the current
expression is evaluted, whereas i++ increments the number after the
expression is evaluated.
See this question