

6 or so New Approved and Proposed JavaScript APIs
9 snips Aug 16, 2023
Delve into exciting new JavaScript APIs like Promise.withResolvers and the versatile .at() method that works for both arrays and strings. Discover the benefits of immutable array methods, ensuring safer data practices. The potential of Array.fromAsync for handling asynchronous operations is explored, along with innovative features like observable events and array grouping. The hosts also share humorous vacation stories involving left-side driving and quirky right-hand drive mail vehicles, blending tech insights with lighthearted adventures.
AI Snips
Chapters
Transcript
Episode notes
Promise.withResolvers
Promise.withResolvers
offers a new way to interact with promises.- It returns a promise along with its
resolve
andreject
methods, enabling more control over asynchronous operations.
.at() Method
- The
.at()
method simplifies array and string element access, including reverse indexing. - It improves code clarity and eliminates the need for verbose workarounds.
Immutable Array Methods
- Embrace immutable array methods like
.toReversed()
,.toSorted()
,.toSpliced()
, and.with()
. - They improve code predictability by preventing unintended side effects from mutating the original array.