javascript - Unexpected token error on my for loop -


function count(num){     var nums=[];      for(i=1;i<num){         var n=integer.tostring(i);         nums.add(n);         i++;     }     return nums; } 

i'm getting error on loop

you need this:

for (i = 0; < num;)

for-loops take in 3 parameters.


Comments

Popular posts from this blog

sublimetext3 - what keyboard shortcut is to comment/uncomment for this script tag in sublime -

java - No use of nillable="0" in SOAP Webservice -

ubuntu - Laravel 5.2 quickstart guide gives Not Found Error -