Syntax - Tasty Web Development Treats

New to JavaScript — ES2022

Sep 15, 2021
Discover the latest features of JavaScript ES2022, including regex indices with the new 'D' flag for better match tracking. Learn about private fields in classes, making encapsulation easier than ever. Explore the top-level await feature, simplifying asynchronous coding. The hosts share insights on the innovative Temporal API for date handling. Personal anecdotes add a fun touch, highlighting the joys and challenges of moving and smart home technology.
Ask episode
AI Snips
Chapters
Transcript
Episode notes
INSIGHT

Regex Indices

  • The new d flag in regex expressions gives indices of matches.
  • This is useful for highlighting or replacing matches in strings, such as search results.
INSIGHT

Class Updates: Private Fields

  • Private class fields and methods, prefixed with #, enhance code organization.
  • This clarifies internal state and restricts direct external access, promoting better API design.
ADVICE

Class Updates: Class Fields

  • Use class fields to define properties directly within a class.
  • This simplifies property declaration compared to constructors, improving code readability.
Get the Snipd Podcast app to discover more snips from this episode
Get the app