🔥 There are 446 Hot Tips!!

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.

🔥 Depcheck will show you unused dependencies in your package.json

Handy for clean up after a big refactor

npm i -g depcheck
1.4K27819204
1624
4803089.1K

🔥 Here is a neat one! Since arrays are objects, we can destructure their indexes to easily grab the first and last items.

3.5K94066345

🔥 Use Intl.Collator() to easily sort or group strings regardless of their case or accent

503117640

🔥 New in ES2019, we have a .flat() method to flatten these types of chunked arrays.

20142711

🔥 When working with an API, I often need to chunk up a list of users and send them in batches.

Array.from() is a great way to chunk up arrays because of the secondary argument being a map function.

1.1K18619152

🔥 Use Intl.PluralRules() to easily find the ordinal for numbers - 1st, 2nd, 3rd, 4th...

779120985

🔥 Use Intl.DateTimeFormat() to create nicely formatted date and time strings

1.6K31319255

🔥 Use Intl.RelativeTimeFormat() to get nicely formatted relative time strings.

2.4K57921288

🔥 Object.fromEntries() is a new method for converting Arrays, maps or other iterables into objects

1K2431681

🔥 Use CSS Variables to do partial property overwrites. Handy for CSS properties that only accept multiple values.

544111839