javascript - why isnt this setInveral function working? -


i cant figure out i'm doing wrong

 function countnum(){      let num=0;      function inner(){             num++             console.log(num);                }           }   setinterval(countnum,1000) 

you defining function not calling

function countnum(){      let num=0;      function inner(){             num++             console.log(num);                }               inner();/////////////////////////////           }   setinterval(countnum,1000) 

Comments

Popular posts from this blog

php - Autoloader issue not returning Class -

python - Getting next two indexes regardless of current index -

ruby - Prevent Custom Validation Error on Association -