Part 3 of my new image formats as background-image journey (part 1, part 2). Avif and webp images bring a positive impact on every webpage's payload performance. Today (March 16 2021) avif works only in chromium based browsers and webp have "partial support" in macOS safari, we cannot use one-for-all.
Every once in awhile I see code that debounces expensive events like resize or scroll: someTimeout = window.setTimeout(debounceScroll, 10); and I wonder about the magic numbers, developers choose. magic numbers In the example the dev thinks 10 milliseconds is a good time to debounce this event. The whole code