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.
π₯ Intersection Observer is handy for when you need to disable a UI until something has been shown on screen. In this case we can check if the last element of a terms and conditions has been totally shown before enabling the accept button. code in followup tweet ππ»
π₯ If you are trying to add/remove multiple classes from an element, an array spread is the perfect use case here since classList.remove() requires multiple arguments.
Instead of it passing in 1 array arg, it passes each item of the array as a separate argument
π₯ If the Fetch API seems a little cumbersome and you donβt want to reach for Axios, you can always make a handy little function that applies your defaults (assumes JSON) and can be overwritten if needed
π₯ Making a copy of an object and need everything but a property? Use JavaScript destructuring to pull that prop out and then use a ...rest to collect the rest!
π₯ Firefox fonts tab will show you if a font used is a webfont or a system font. Handy when you arenβt sure if web fonts are working, or falling back to system.