Developer Carlos Caballero
Getting an array of unique
values is probably easier than you think.
Ever need to filter falsy values (0, undefined, null, false, etc.) out of an array? Just pass Boolean and all those falsy value go away!
Object.fromEntries()
in ES10! Transform a list of key & value pairs into an object
A stable sorting algorithm is when two objects with equal keys appear in the same order in the sorted output as they appear in the unsorted input
Understanding Default Values with JavaScript's Destructuring
🧠🧠
const { eyes = ' 👀' } = object
Flatten Arrays in Vanilla JavaScript using flat()
and flatMap()
Function.toString()
in ES10! The toString()
method returns a string representing the source code of the function
Dynamic import()
returns a promise for the module namespace object of the requested module. Therefore, imports can now be assigned to a variable using async/await.
Multi condition checking! if input is '🔬', '📜', or '👊', call doSomething function then you can use a nice shorthand 👍
Best Replies
- You could also just write
['🔬', '📜', '👊'].includes(input)
- there's no need for the comparison function. Lenz Weber
The reduceRight
method applies a function against an accumulator and each value of the array (from right-to-left) to reduce it to a single value.
Asynchronous Iteration in ES2018! Asynchronous iterators returns a promise for a { value, done } pair. we can now use the await keyword with for … of loops.
BigInt is the 7th primitive type in ES10! BigInt is an arbitrary-precision integer. What this means is that variables can now represent 2⁵³ numbers.
globalThis in ES10! The global this was not standardized before ES10. However, you would standardize it across multiple platforms on your own but now there is globalThis Object.
The findOne method simulates the search for a data in a data structure that takes 2 seconds to resolve the result
Promise.all - If any promises is rejected then immediately rejects with that error Promise.allSettled - Wait for all passed promises to settle
The Optional Chaining Operator allows handle many of those cases without repeating themselves and/or assigning intermediate results in temporary variables.
The Optional Chaining Operator allows handle many of those cases without repeating themselves and/or assigning intermediate results in temporary variables.