December 2019
Beginner
464 pages
10h 31m
English
In This Chapter
• Learn how to delay when your code runs
• Figure out several ways to run your code repeatedly without blocking your entire app
By default, our code runs synchronously. That is a fancy of way of saying that when a statement needs to execute, it executes immediately. There are no ands, ifs, or buts about it. The concept of delaying execution or deferring work to later isn’t a part of JavaScript’s default behavior. We kind of saw this when looking at loops earlier. The loop runs at lightning speed with no delay between each iteration. That is great for making quick calculations, but that isn’t great if we want to make an update at a more measured (aka slower!) pace.
All of this doesn’t mean the ability to stop work ...