A touchstart or wheel listener can call preventDefault(), so the browser cannot begin scrolling until the handler has run. Every such listener therefore delays scrolling, whether or not…
for…of is not array syntax; it works on anything implementing the iterable protocol, which is one well-known method returning an object with a next(). A generator method is…
fetch rejects on a network failure and resolves on every HTTP response, including 404 and 500. Code that only has a catch therefore treats an error page as…
Promise.all gives one promise for many, and its failure behaviour is the part that gets assumed rather than read: the first rejection rejects the whole thing immediately, while…
XMLHttpRequest sends cookies to the same origin by default. fetch does not, so a session-authenticated endpoint that worked with jQuery returns 401 after the migration and looks like…
jQuery 3 made $.ready resolve asynchronously and always, which is more correct and changes the timing of code that had been relying on the synchronous path. The breakage…
A component that only renders props needs no class, no constructor and no lifecycle. Written as a function it is shorter and, more usefully, it cannot accidentally acquire…
A default export has no name at the boundary, so the importing file invents one. Rename the thing being exported and every import keeps working under the old…
[…new Set(values)] is the shortest deduplication in the language and it compares by identity, so it does nothing at all for a list of objects that happen to…