Posted May 27, 2020 • 1 min read
Performance optimization is one of the necessary skills for front-end development. Of course, we must pay attention to and master it.
Anti-shake:A large amount of the same event is triggered in a short time, and the function will only be executed once. Related to setTimeout function.
Throttling:The same event is triggered in a large amount in a short period of time. After the function is executed once, the function will no longer work within the specified time until it takes effect again after this time.