JOIN DEVPPL

It looks like you are new here. If you want to get involved, click on Join below!



i++ [i] variable in Javascript needed?


C

keyboard_arrow_up
1
keyboard_arrow_down


First Post Mark as Spam chelseacruise
Posts: 1 - Registered: 2013-07-17 19:10:47

Hi. Why is the 'i' in Javascript needed for a variable in a loop? I'm pretty sure you can use another letter, right?

Example:
for(var i=0; i<bullets.length; i++) {
var bullet = bullets;

Thanks!




J

keyboard_arrow_up
0
keyboard_arrow_down


Reply #1 Mark as Spam joesimmons
Posts: 5 - Registered: 2013-09-06 14:02:57

You can use any variable name you wish. 'i' is just common and well recognized, so it's used more often.






JOIN DEVPPL

It looks like you are new here. If you want to get involved, click on Join below!




MENU
Advertising