Hot tips are spicy lil' nuggets related to web development and tooling that I share on my twitter account. I've logged them here to make them easier to find.
Page 18 of 46
π₯ use Promise.allSettled() to wait until all promises have either been fulfilled or rejected.
Promise.allSettled()
Handy for when a promise rejects, but you still want the data of the successful ones.
π₯ Pretty excited about the new JavaScript non-mutating array methods. Currently in stage 3.
.toReversed()
.toSorted()
.toSpliced() - remove items
.toSpliced()
.with() - replace items
.with()
π₯ Format large numbers in your JavaScript with numeric separators.
const milly = 1_000_000;
This doesn't affect how the number works or is displayed - just helpful for reading large values quickly.
Running a Node / npm app in Deno - does it work?
π₯ Why do you sometimes see !!double bang in front of variables in JavaScript?
π₯ Did you know you can use type=βmoduleβ in a script tag block? Import external dependencies and use top level await without any tooling!
type=βmoduleβ
π₯ Use CSS :has() to select items based on what children they have.
:has()
This :has() never been possible in CSS before this and is pretty exciting.
I made a browser extension to detect who has paid $8 for their blue checkmark
π₯ JS Fundamentals: what is truthy and falsy?
π₯ Use CSS :where() to select multiple children inside a parent selector.
:where()
Super handy for H1 β H6 and selecting all inputs inside a form.
Anthropic doesnβt use AI