difference between countUp() and countUp [duplicate]
问题 This question already has answers here : what is the difference between calling function in JavaScript with or without parentheses () (3 answers) Closed 6 years ago . I have a script that counts up the number in a box (actually, in this exercise -> http://jqexercise.droppages.com/#page_0022_ ) each 1 second like this. var target = $("#target input"); var countUp = function(){ target.val(parseInt(target.val())+1); setTimeout(countUp,1000); // this line }; countUp(); My questions is, when i