for browser it is the same :
https://stackoverflow.com/questions/20420429/what-the-difference-between-window-settimeout-and-settimeout
Assuming we're talking about browser-based JavaScript: No difference. setTimeout() simply omits the window., which is implied. The effect they have is exactly the same.
It's a choice of coding style and preference.
For JavaScript that does not run in a browser, the window object is not defined, so window.setTimeout() will fail. setTimeout() however, wi
No comments:
Post a Comment