Every web developer has seen this code at least once in their life: setTimeout(() => { /*Do some stuff*/ }, 0); However, many people take it as some magic that should be applied when things don't work as expected (race conditions, slowness, etc.). More advanced developers know that it postpones the code execution to the "next tick" (or some variation). Only a few would know how to explain what exactly happens there step by step.
Is this you? As a journalist, you can create a free Muck Rack account to customize your profile, list your contact preferences, and upload a portfolio of your best work.
Claim your profile
Get in touch with JeB
Contact JeB, search articles and posts on X, monitor coverage, and track replies from one place.
Learn more about Muck RackActions
Is this you?
As a journalist, you can create a free Muck Rack account to customize your profile, list your contact preferences, and upload a portfolio of your best work.Articles
How to Score 100 on Lighthouse
While you may be using SSR, having all the content discoverable in the initial HTML, using a CDN for caching, and following all the best practices for Core Web Vitals, there's a good chance you're still having trouble scoring a Lighthouse score higher than 75. If that's the case, you're in the right place. If not, you've got a lot of work to do. Don't waste your time! Just kidding, you really should read this even if you don't follow all the best practices.
Optimizing Your Web App: How to Score 100 on Lighthouse
Optimizing Your Web App: How To Score 100 on Lighthouse Why is Lighthouse score so different from field data? What is TBT? How large bundle size and long tasks affect performance? While you may be using SSR, having all the content discoverable in the initial HTML, using a CDN for caching, and following all the best practices for Core Web Vitals, there’s a good chance you’re still having trouble scoring a Lighthouse score higher than 75. If that’s the case, you’re in the right place.
Actions
Is this you?
As a journalist, you can create a free Muck Rack account to customize your profile, list your contact preferences, and upload a portfolio of your best work.Get in touch with JeB
Contact JeB, search articles and posts on X, monitor coverage, and track replies from one place.
Learn more about Muck Rack