Syntax - Tasty Web Development Treats
Syntax - Tasty Web Development Treats

What's New in Javascript

In this episode of Syntax, Scott and Wes talk about what is new in Javascript — a whole bunch of new stuff that you can use now and in the next sixth months or so. LogRocket - Sponsor LogRocket lets you replay what users do on your site, helping you reproduce bugs and fix issues faster. It’s an exce

Featured Speakers

Wes Bos & Scott Tolinski - Full Stack JavaScript Web Developers Host

Topics Discussed

Episode Summary

Executive Summary: The episode surveys major JavaScript, browser, and Node.js features emerging in ES2019/ES2020 and beyond, emphasizing how they simplify common patterns like array flattening, object conversion, safe property access, and async imports. Wes and Scott highlight practical wins for readability, performance, and cross-environment code, while also noting experimental proposals that may shape future JavaScript development.

Main Topics: Modern array and object utilities: The hosts cover new built-in helpers like Array.flat, FlatMap, and Object.fromEntries that reduce reliance on Lodash and make data transformations more direct and readable. Safer string and object access patterns: They discuss trimStart/trimEnd, optional chaining, and nullish coalescing as ergonomic syntax improvements that avoid common bugs with whitespace and missing values. Promise and module improvements: The episode explains Promise.allSettled, dynamic import, top-level await, and module namespace exports as additions that improve async workflows, code splitting, and module composition. Language/runtime edge cases and numeric limits: BigInt, object key ordering, Function.toString, and Infinity are discussed as practical clarifications or fixes for JavaScript’s long-standing quirks and limitations. Browser and platform APIs: They cover navigator.share, navigator.canShare, and ResizeObserver as browser APIs that expand what web apps can do natively and reduce the gap with native apps. Experimental proposals and future syntax: The hosts briefly discuss pipeline operator and async hooks as promising but still experimental features that may eventually reshape composition and low-level runtime instrumentation. Tooling, sponsors, and sick picks: The episode includes sponsor reads for LogRocket and FreshBooks, plus side discussion of Sapper and a DeWalt oscillating multi-tool as practical recommendations.

Key Arguments: Native JavaScript is absorbing many utility functions traditionally provided by Lodash, making external dependencies less necessary. FlatMap and Flat simplify nested array handling and make transformations easier to express than manual map/reduce chains. Object.fromEntries is especially useful for converting transformed key-value arrays back into objects without verbose reduce logic. TrimStart and trimEnd provide a cleaner way to remove whitespace on only one side of a string. Functionality like optional chaining and nullish coalescing significantly reduce defensive coding around undefined or null values. Optional chaining is especially valuable because it short-circuits safely through deep object paths and even array access. BigInt exists to solve the real upper-bound problem of JavaScript numbers, which can break APIs and IDs at large scale. Dynamic import and top-level await improve code splitting and module initialization without forcing everything into top-level synchronous code. Navigator.share and ResizeObserver are examples of the web platform catching up to capabilities that previously required native apps or polyfills. Experimental features like pipeline operator are appealing for readability, but may remain in proposal stage for a long time.

Data Points: JavaScript number upper limit: 2^53 - 1 - Scott explains the default numeric limit before BigInt is needed. Array.flat depth: Infinity - Using Infinity as the depth argument flattens all nested arrays. LogRocket free trial: 14 days - Sponsor offer mentioned during the LogRocket read. FreshBooks free trial: 30-day unrestricted free trial - Sponsor offer mentioned during the FreshBooks read. Syntax episode numbering issue: Episode 130 or 98 (mentioned as the point of failure) - Wes describes having to renumber early episodes because of leading zeros and parsing issues. Site transfer size: 60 kb total transferred - Wes describes his Sapper site as very lightweight. Site load time: 100 milliseconds - Wes says his Sapper site loaded very quickly.

Pivotal Quotes: "This optional chaining. It makes so many places where I've had this. You check for the first property, and if that's there, then you check for the second property. And if that's there, you check for the third property." — Wes: Explaining why optional chaining is one of the most useful new syntax additions. "Native JavaScript is absorbing many utility functions traditionally provided by Lodash, making external dependencies less necessary." — Wes: Summarizing the broader trend behind FlatMap, Flat, and related methods. "So if you want to check if something is either null or undefined and not an empty string, not False and not zero, then you can use this new operator, which is question mark, question mark." — Wes: Describing nullish coalescing and how it differs from logical OR.

Implications: Listeners should expect less boilerplate, fewer defensive bugs, and more native solutions to common JS patterns. Teams can ship smaller, clearer codebases while gradually adopting new syntax and APIs as browsers, Node, and tooling support them.

🔓 Sign Up for Unlimited Episode Search

About Syntax - Tasty Web Development Treats

View all episodes from Syntax - Tasty Web Development Treats