0
why?
hi i have trouble of memory number++ means number+1 or 2 right? why here; function test(number) { while(number < 5) { number++; } return number; } alert(test(2)); the result is not 3 or 4 ?
2 Answers
+ 2
number++ means number+1
Answer should be 5
+ 2
number++ is equivalent to number=number+1.
You are using a while loop in the loop you declared number++.
When number==5 the while loop stops.
That's why the result is 5.