setTimeout(calculate,1000);
In a setTimeout() or setInterval() statement, either define an anonymous function or provide a reference to a named function, but (typically)don't execute it.
Execution happens when the time period has expired.
"Typically" above: Javascript functions are first class objects. You might one day encounter a function that returns a function, in which case you might see a function call inside a setTimeout() or setInterval() statement.
Airshow
Airshow
WiFi Lounge Lizard
2,682 posts since Apr 2009
Reputation Points: 321
Solved Threads: 372