19 JavaScript nuggets!
Published on 27 April 2020
• 1 min
Cette page est également disponible en français.
Starting May 4th, we’ll launch a series called “19 nuggets of vanilla JS,” with a daily article (not too long, great for nibbling) on a facet of pure JavaScript language; or a protip, best practice, poorly known ability, mythbusting, demystifying, etc. 19 reasons to come back!
What’s in there?
Woah, lots of stuff. Light stuff, heavy stuff, thought-provoking stuff…
(Edit end of series: the entire list is now available here for easier consumption.)
- Efficiently deduplicating an array
- Efficiently extracting a substring
- Properly formatting a number
Array#splice
- Strings and Unicode
- Short-circuiting nested loops
- Inverting two values with destructuring
- Easily stripping “blank values” from an array
- Long live numeric separators!
- Properly sorting texts
- Extracting emojis from a text
- Properly defining optional named parameters
const
is the newvar
- Using named captures
- Object spread vs.
Object.assign
- Converting an object to
Map
and vice-versa - The
for
-of
loop: should there remain only one… - Simulating an abstract class with
new.target
- Negative array indices thanks to proxies
So keep a sharp eye out for daily releases!