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

Top 18 New Things in JS - Part 1

In this episode Wes and Scott discuss their favorite top 18 new things in Javascript. Freshbooks - Sponsor Get a 30 day free trial of Freshbooks at freshbooks.com/syntax and put SYNTAX in the “How did you hear about us?” section. Mlab - Sponsor mLab is the leading Database-as-a-Service for MongoDB,

Featured Speakers

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

Topics Discussed

Episode Summary

Executive Summary: Syntax hosts Scott and Wes discuss the first nine of 18 JavaScript features they find especially useful, focusing on syntax and patterns that make everyday code clearer and less error-prone. They cover modern variable declarations, strings, destructuring, promises, async/await, and object syntax, sharing practical use cases and cautioning listeners to choose practices thoughtfully. The episode also includes sponsor messages and brief personal updates.

Main Topics: Modern variable declarations: const and let: The hosts recommend const by default and let when reassignment is needed, while explaining that const prevents rebinding rather than mutation of an object's properties. Unlike var, const and let are block-scoped and cannot be redeclared in the same scope. Template literals: Backtick strings allow interpolation with ${...} and avoid much of the punctuation required for string concatenation. Tagged template literals can pass string segments and interpolated values to a function, with styled-components as an example. Destructuring objects, arrays, and function parameters: Destructuring extracts selected values into variables, can rename properties, and can provide fallback values. The speakers describe using it with React props, API responses, arrays, and Promise.all results. Promises: Promises represent results that will be available asynchronously and can resolve or reject. Chaining them offers a way to sequence asynchronous work and avoid deeply nested callbacks; database queries are one example. Async/await: The hosts describe async/await as syntax built on promises that makes asynchronous code easier to read. Await pauses execution within an async function until a promise settles, while error handling can use try/catch or other approaches. Computed properties and concise object methods: Computed property names let a variable determine an object's property key during creation, useful for generic form handling. Concise method syntax removes the function keyword from object methods without changing their regular function behavior.

Key Arguments: Using const by default and let only when reassignment is required can help prevent accidental variable replacement; however, the hosts caution against treating var as universally harmful or imposing rigid rules. Template literals and destructuring reduce repetitive syntax and can make code more readable, especially when working with strings, objects, API results, and React props. Destructuring can handle missing values with defaults and rename extracted properties, but deeply nested defaults can become difficult to understand; explicit checks may be clearer. Promises provide a consistent model for asynchronous operations, including API or database work, and avoid the complexity of deeply nested callbacks. Async/await makes promise-based code more straightforward to read, while still returning promises itself. Error handling remains an important design choice that may vary by context. Features should be adopted based on their usefulness and the developer's context, rather than absolute claims that older syntax is always bad.

Data Points: JavaScript features covered in this episode: 9 - The hosts present the first half of a planned list of 18 features, with the remainder scheduled for the next episode. Features in the overall list: 18 - The two-part series is framed as a selection of the hosts' favorite newer JavaScript features. Denver Startup Week duration: Monday through Friday - Wes describes it as a free week of talks held at locations around the city. Denver Startup Week tracks: About 6 - The event includes tracks such as entrepreneurship, marketing, design, and development. FreshBooks free trial: 30 days - The sponsor segment describes an unrestricted trial for the cloud accounting service. Coffee machine usage: Almost 9,000 cups - Wes says the household Jura coffee machine reported brewing nearly this many cups. Used coffee machine purchase price: $200 - Wes says he bought the machine used; he contrasts it with a stated new price of about $3,000. Breakdancing competition participants: 16 - Wes describes a one-on-one bracket tournament featuring 16 of the world's top breakdancers. Annual Level Up Pro discount: 25% - Scott says an annual subscription saves 25% compared with signing up without the yearly plan. Level Up Pro video library: More than 300 videos - Scott describes the existing collection available to subscribers.

Pivotal Quotes: "I use const by default and then I use let only when I need to redeclare it." — Wes: Wes explains his preferred approach to variable declarations and how it helps avoid accidental reassignment. "JavaScript waits for no one." — Wes: He uses this phrase to explain why asynchronous work needs a mechanism such as promises. "It's probably my favorite thing that's been added to JavaScript ever." — Wes: Wes expresses his enthusiasm for async/await and its readability.

Implications: These features can reduce boilerplate and make asynchronous and data-handling code easier to follow. Developers should understand their semantics, use them where they improve clarity, and avoid treating stylistic preferences as universal rules.

🔓 Sign Up for Unlimited Episode Search

About Syntax - Tasty Web Development Treats

View all episodes from Syntax - Tasty Web Development Treats