Hot answers tagged


In JavaScript, sync and async lines are handled differently. In the JS event loop first sync events are handeled, after which on a diffrent thread, async events are handled. It becomes important to pass context in JavaScript. Use .bind(this) for your setInterval anonymous function so that context will be maintained.

Only top voted, non community-wiki answers of a minimum length are eligible