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 15 of 44
π₯ Forgot to add a file to your .gitignore?
.gitignore
Heres how to remove that file from your git repo after the fact
Yesterday I renamed a file from File.jpg β file.jpg, but it didn't trigger any changes in my git repo, which means I wasn't able to deploy it.
Had to use git mv to rename the file in my git repo as well.
git mv
Your language isnβt broken, itβs just doing floating point math!
π₯ CLI Bracket Expansion! Super handy when you need to create, install or rename multiple files in a single go.
touch store-{products,cart,coupons,utils}.js
π₯ take big, but nicely formatted, dumps in your console with console.table()
console.table()
π₯ 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?