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 17 of 44
π₯ Make a webcam photobooth app in about 15 lines of JavaScript
π₯ Format relative time amounts - like "2 seconds ago" - with the JS Intl.RelativeTimeFormat() API
Intl.RelativeTimeFormat()
π₯ Use TypeScript's never to enforce "one or the other" properties on a type
never
π₯ Emojis like π¨βπ§βπ¦ and π πΏ are actually made up of multiple emojis and a special character called a βZero Width Joinerβ
π₯ Weird one: Any HTML element can be visible and editable with display:block; and contenteditable - including style tags!
π₯ You don't need a library to format money in JavaScript!
Use Intl.NumberFormat() to format all currencies and locales around the world.
Intl.NumberFormat()
π₯ TypeScript's never is great for making sure you hit every scenario when coding an if/else or switch statement
π₯ You can create a Type Guard in TypeScript by using the is keyword in a functions return type.
is
π₯ The difference between any and unknown in TypeScript:
any
unknown
π₯ Text Pastry is a super handy plugin for inserting incremental numbers at each cursor.
Available for VS Code, Sublime + more