Lessons
-
MDX v2 syntax
An introduction to the syntax supported in the upcomming MDX v2 release.
-
Add Prism Highlighting to a Gatsby Blog Theme site
Use the built-in prismPreset option to add prism highlighting to gatsby-theme-blog.
-
Install and configure Gatsby Theme Blog
Set up gatsby-theme-blog in order to add pre-built blog functionality to your Gatsby site.
-
Safely Access a Property on a JavaScript Array with Optional Chaining
You can use optional chaining to access elements in an array. If the array is null or undefined, attempting to access an element with optional chaining prevents an error from being thrown, returning undefined instead.
-
Safely Access a Property on a JavaScript Object with Optional Chaining
You can use optional chaining to access properties of an object. If the parent property exists, it acts as a typical dot accessor. If not, optional chaining prevents an error from being thrown and instead returns undefined.
-
Consume a Stream of Events Using the FromEvent Operator in RxJS
Learn how you can use fromEvent as if it were addEventListener. Create an observable stream of actions on an HTML DOM element.
-
Creating a Stream from a Set of Items Using the RxJS Of Operator
Use the RxJS of operator to create a stream with a set of data. Use the interval and zip operators to time delay each piece of data in the stream.
-
Creating a Stream from an Array of Items Using the RxJS From Operator
Use the RxJS from operator to create a stream with an array of data. Use the interval and zip operators to time delay each element in the stream.
-
Add and Remove Elements in an Array Using Splice
Learn how to use splice with one, two or three+ arguments. With one argument...
-
Find and Fix Keybinding Clashes in VS Code
Determine whether a keybinding in VS Code is duplicated and change the binding to a unique set of keys so you can use the shortcut.
-
Apply Colors to your VS Code border to Differentiate Between Windows
Use the Peacock extension to assign colors to the border of each VS code window or project.
-
Conditionally Assign Style to a Parent Element with Focus-Within Pseudo-class
Use the focus-within pseudo-class to conditionally assign styling to a parent element when its child receives focus.
-
Conditionally Style an Element with the Focus Pseudo-class
Use the focus pseudo-class to assign conditional styling when I user selects an element.
-
Conditionally Apply Style on Hover with the CSS Hover Pseudo-class
Use the hover pseudo-class to apply conditional styling when a user interacts with an element but has not yet activated it.
-
Nested Destructuring for Objects
Use nested destructuring to access the value of an object within an object.
-
Array.prototype.flatMap from ES2019
Use the flatMap function to both map and flatten at the same time.
-
Copy an Object with the Spread Operator
Use the spread operator to copy a flat object. Note that this is a shallow copy.
-
For...in Loop vs. For...of Loop
Arrays can be iterated through using both for...in and for...of, but there are differences. This video shows that for...of accesses the values of each element and for...in accesses the indexes of each element.
-
Merge Arrays using the Spread Operator
Use the spread operator to merge multiple arrays. This example uses two, but the same pattern can be used for more.
-
Merge Objects with JavaScript's Spread Operator
Using the spread operator you can merge objects. This example uses two objects, but the syntax is the same for more. Note that duplicate keys will be overridden.
-
Copy an Array with the Spread Operator
Use the spread operator to create a copy of a flattened array.
-
Convert an Object to an Array and back again with Object.entries and Object.fromEntries
Use these functions in order to flip back and forth between an Object and an Array.
-
Flatten a Nested Array in JavaScript with Array.prototype.flat
This is an example of how to use the flat method available on the array prototype in JavaScript.