The Recent Parts (2019) – frontendmasters
Learn the latest features in JavaScript with Kyle Simpson, author of the popular, You Don’t Know JS, book series. You’ll get up to speed with new JavaScript features like tagged template literals, destructuring, iterators, generators, regex improvements and async await.
This course and others like it are available as part of our Frontend Masters video subscription.
Table of Contents
Introduction
JavaScript New Feature Process
00:00:00 – 00:11:24
JavaScript New Feature Process
Kyle Simpson begins by giving context to the frustration with the fast pace of JavaScript’s evolution by talking about the dark ages of JavaScript, and explaining how the language has gotten to the present day feature process. – https://static.frontendmasters.com/resources/2019-03-09-js-recent-parts/js-recent-parts.pdf
Declarative JavaScript
00:11:25 – 00:13:49
Declarative JavaScript
Kyle explains why the changes that are coming to JavaScript make the language more declarative.
Browser Support & Transpilers
00:13:50 – 00:19:05
Browser Support & Transpilers
Kyle assuages developer’s fears of not supporting their users when new features are implemented by introducing transpilers as a standard for the language.
Course Overview
00:19:06 – 00:22:13
Course Overview
Kyle defines what the “recent parts†means as part of the title, and gives a roadmap for what the course will contain.
Strings
Template Strings
00:22:14 – 00:32:01
Template Strings
Kyle introduces a more declarative way of introducing variables to strings than the default string concatenation.
Tagged Templates
00:32:02 – 00:37:44
Tagged Templates
Kyle introduces tagged literals, gives a simple example of when they could be useful, and describes where to find prewritten libraries to help in your code.
Applying Tagged Templates
00:37:45 – 00:42:47
Applying Tagged Templates
Kyle demonstrates an application for tagged literals that logs objects in the console.
Tagged Template Exercise
00:42:48 – 00:43:57
Tagged Template Exercise
Students are instructed to utilize both template strings, and tagged templates in a statement that is logged in the console. – https://static.frontendmasters.com/resources/2019-03-09-js-recent-parts/js-recent-parts.zip
Tagged Template Solution
00:43:58 – 00:46:21
Tagged Template Solution
Kyle live codes the solution to the exercise.
Padding & Trimming
00:46:22 – 00:53:25
Padding & Trimming
Kyle introduces string padding, and string trimming.
Array Destructuring
Destructuring
00:53:26 – 01:05:05
Destructuring
Kyle breaks down destructuring, and gives a tangable example of how it makes the code more declarative.
Refactoring Code Using Destructuring
01:05:06 – 01:13:53
Refactoring Code Using Destructuring
Kyle demonstrates how to implement the previous conversation about destructuring.
Spread Operator & Declaring Destructured Arrays
01:13:54 – 01:17:44
Spread Operator & Declaring Destructured Arrays
Kyle introduces the spread operator to the example, and then goes on to explain how the example without destructuring differs in behavior to the example with destructuring.
Declaration & Assignment
01:17:45 – 01:24:40
Declaration & Assignment
Kyle defined the difference between declaration and assignment, and explains both in the context of destructuring.
Comma Separation
01:24:41 – 01:29:07
Comma Separation
Kyle demonstrates how to use commas to omit a value that is returned when destructuring.
Parameter Arrays
01:29:08 – 01:35:27
Parameter Arrays
Kyle demonstrates how to apply destructuring when the function signature contains an array, and applies the concept of gracefully falling back when what was returned is null.
Nested Array Destructuring
01:35:28 – 01:40:41
Nested Array Destructuring
Kyle demonstrates how to to access a returned data structure’s values when it is known that there are nested arrays.
Object Destructuring
Object Destructuring
01:40:42 – 01:48:29
Object Destructuring
Kyle demonstrates how to assign default parameters, and utilize the spread operator.
Object Assignment Destructuring
01:48:30 – 01:52:07
Object Assignment Destructuring
Kyle explains how JavaScript distiguishes blocks from destructuring when assignment is separate from declaration.
Object Default Assignment
01:52:08 – 01:55:03
Object Default Assignment
Kyle demonstrates how to ensure object destructuring falls back gracefully when the values are null.
Nested Object Destructuring
01:55:04 – 01:57:29
Nested Object Destructuring
Kyle demonstrates how to access a returned data structure’s values when it is known that there are objects.
Default Assignment Q&A
01:57:30 – 02:01:16
Default Assignment Q&A
A question is asked about the proper way to give a default assignment.
Parameter Objects
02:01:17 – 02:04:08
Parameter Objects
Kyle demonstrates how to apply destructuring when the function signature contains an object.
Nested Object & Array Destructuring
02:04:09 – 02:07:38
Nested Object & Array Destructuring
Kyle demonstrates how to access a returned data structure’s values when it is known that there are both objects and arrrays.
Further Destructuring
Named Arguments
02:07:39 – 02:11:29
Named Arguments
Kyle demonstrates a method of improving the readability of code by naming arguments.
Destructuring & Restructuring
02:11:30 – 02:17:38
Destructuring & Restructuring
Kyle introduces a method to mix methods at a call site.
Destructuring Exercise
02:17:39 – 02:19:08
Destructuring Exercise
Students are instructed to destructure an AJAX response, then restructure the parameters. – https://static.frontendmasters.com/resources/2019-03-09-js-recent-parts/js-recent-parts.zip
Destructuring Solution
02:19:09 – 02:21:18
Destructuring Solution
Kyle live codes the solution to the exercise.
Array Methods
find, findIndex, & includes
02:21:19 – 02:26:12
find, findIndex, & includes
Kyle introduces new array methods .find, findIndex, and .includes that search an array.
flat & flatMap
02:26:13 – 02:34:26
flat & flatMap
Kyle introduces new array methods .flat and .flatmap that augment nested arrays.
Iterators & Generators
Iterators
02:34:27 – 02:39:08
Iterators
Kyle defines what an iterator is, and walks through an example where an iterator is instantialized, and an iterator result is produced.
Declarative Iterators
02:39:09 – 02:43:32
Declarative Iterators
Kyle introduces the new built in key word “of†and spread operator as declarative methods to iterate over data structures.
Data Structure without Iterators
02:43:33 – 02:47:37
Data Structure without Iterators
Kyle discusses the issues that arise when attempting to iterate over data structures such as an object, and demonstrates a strategy for overcoming this.
Generators
02:47:38 – 02:58:41
Generators
Kyle demonstrates how to use generators to iterate over data structures without iterable attributes.
Iterator & Generator Exercise
02:58:42 – 03:01:31
Iterator & Generator Exercise
Students are instructed to implement an iterator and generator to log lucky numbers. – https://static.frontendmasters.com/resources/2019-03-09-js-recent-parts/js-recent-parts.zip
Iterator & Generator Solution
03:01:32 – 03:05:43
Iterator & Generator Solution
Kyle live codes the solution to the exercise.
Regular Expressions
Look Ahead & Behind
03:05:44 – 03:11:30
Look Ahead & Behind
Kyle first reviews look aheads, then introduces the brand-new implementation of look behinds.
Named Capture Groups
03:11:31 – 03:15:28
Named Capture Groups
Kyle introduces a method to organize regular expressions and make them more human readable.
dotall Mode
03:15:29 – 03:18:05
dotall Mode
Kyle demonstrates how to utilize the dotall mode to select elements of a string.
Regex Exercise
03:18:06 – 03:21:57
Regex Exercise
Students are instructed to utilize all three of the features learned in the last few sections, as well as earlier lessons to log selected portions of a poem provided by Kyle. – https://static.frontendmasters.com/resources/2019-03-09-js-recent-parts/js-recent-parts.zip
Regex Solution
03:21:58 – 03:28:36
Regex Solution
Kyle live codes the solution to the exercise.
Async Await
Async Functions
03:28:37 – 03:34:50
Async Functions
Kyle gives context to what was done previous to the availability of the sync-async pattern, then goes on to explain how the async function accomplishes essentially what the async function accomplished.
Async Await Exercise
03:34:51 – 03:36:44
Async Await Exercise
Students are instructed to construct an async function where files are given to the function by a mock AJAX call, and are logged in the order that they are received. – https://static.frontendmasters.com/resources/2019-03-09-js-recent-parts/js-recent-parts.zip
Async Await Solution
03:36:45 – 03:40:30
Async Await Solution
Kyle live codes the solution to the exercise, and demonstrates a common mistake that students are likely to make.
Async Iteration
03:40:31 – 03:44:18
Async Iteration
Kyle goes into further detail on why await cannot be used in a regular function, and offers up a library that fills the gap in the language.
Async Function Problems
03:44:19 – 03:55:44
Async Function Problems
Kyle exposes the issues with async functions, including that it only accepts true promises, and a scheduling issue that causes starvation.
Async Generators with yield
03:55:45 – 04:00:40
Async Generators with yield
Kyle introduces a new function type as of ES2018 that allows for yield and await in the same function.
Async Generators Iteration
04:00:41 – 04:08:00
Async Generators Iteration
Kyle explains why async generators are the last piece in the quadrant of async generators.
Wrap-Up
Wrap-Up
04:08:01 – 04:09:59
Wrap-Up
Kyle explains why the audience should be encouraged by the future of JavaScript.