Syntax - Tasty Web Development Treats

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.
Ask episode
AI Snips
Chapters
Transcript
Episode notes
INSIGHT

Promise.withResolvers

  • Promise.withResolvers offers a new way to interact with promises.
  • It returns a promise along with its resolve and reject methods, enabling more control over asynchronous operations.
INSIGHT

.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.
ADVICE

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.
Get the Snipd Podcast app to discover more snips from this episode
Get the app