Browse all JavaScript lessons.

showing All 556 lessons...

Redux: Implementing Store from Scratch

Redux: Store Methods: getState(), dispatch(), and subscribe()

Redux: Writing a Counter Reducer with Tests

Redux: The Reducer Function

Redux: Pure and Impure Functions

Redux: Describing State Changes with Actions

Redux: The Single Immutable State Tree

Intro to Recursion - The Solution

P

Intro to Recursion - The Problem

P

Chaining Web Audio Nodes

P

Converting an array-like object into an Array with Array.from()

P

Intro to the Web Audio API

P

Sort an Array Alphabetically or Numerically

P

Learn to Flatten and Flatmap Arrays with Reduce

P

Avoid Common Mistakes when Working with Reduce

P

Use the Optional Reduce Arguments

P

Use Reduce to Filter and Map over Large Datasets

P

JSPM - Loading CSS with JSPM Plugins

P

Reduce an Array into a Single Object

Transform an Array into a Single Value using Reduce

Immutable.Record() as data models

P

Lightning Fast Immutable.js Equality Checks with Hash Codes

P

Transforming Immutable Data with Reduce

P

Maintaining Order in Immutable.js Objects

P

Simple Undo/Redo with Immutable.js Data Structures

P

Converting Immutable.js Structures to Javascript and other Immutable Types

P

Exploring Sequences and Range() in Immutable.js

P

Differences between the Immutable.js Map() and List()

P

Using fromJS() to Convert Plain JavaScript Objects into Immutable Data

P

Equality Checking with .is() and More

P

Working with Subsets of an Immutable.js Map()

P

Iterating Over an Immutable.js Map()

P

Querying an Immutable.js Map()

P

Modifying an Immutable.js Map()

P

Creating an Immutable Object Graph with Immutable.js Map()

P

Manage Application State with Immutable.js

Using JSHint for Linting with Gulp

P

Understanding function bind() in JavaScript

P

Create a Shallow Copy of an Array with Slice

P

Check if a Value is in an Array with indexOf

P

Combine Values of an Array into a String with Join

P

Use Concat to Add Values to an Array

An Introduction to JSPM (JavaScript Package Manager)

P

const Declarations in es6 (ES2015)

P

Gulp and Browserify - Adding Babel & Source Maps

P

Gulp and Browserify - Adding Live Reload with Browsersync

P

Gulp and Browserify - Hooking up Watchify

P

Gulp and Browserify - Initial Setup

P

Limit Built Branches on Travis

Adding ES6 Support to Tests using Mocha and Babel

redux tutorial about Redux: Implementing Store from Scratch

Redux: Implementing Store from Scratch

2:28 redux

Learn how to build a reasonable approximation of the Redux Store in 20 lines. No magic!

redux tutorial about Redux: Store Methods: getState(), dispatch(), and subscribe()

Redux: Store Methods: getState(), dispatch(), and subscribe()

3:09 redux

We will learn about the Redux Store and demonstrate how its three methods let us implement a counter application.

redux tutorial about Redux: Writing a Counter Reducer with Tests

Redux: Writing a Counter Reducer with Tests

2:36 redux

You will learn how to write the reducer for the counter application in a test driven development way, as well as the conventions in implementing reducers.

redux tutorial about Redux: The Reducer Function

Redux: The Reducer Function

1:54 redux

There is something in common between all Redux applications. They have to implement the reducer: a function that calculates the next state tree based on the previous state tree and the action being dispatched.

We are presenting a “complete” example in the code window below. Feel free to click around and explore! We will be explaining what everything does during this course.

redux tutorial about Redux: Pure and Impure Functions

Redux: Pure and Impure Functions

1:19 redux

Some functions are more predictable than others. You will learn the difference between the pure and impure functions. Understanding this difference is essential for writing Redux applications.

redux tutorial about Redux: Describing State Changes with Actions

Redux: Describing State Changes with Actions

2:54 redux

You will learn how Redux asks you to describe every change in the application state as a plain JavaScript object called “action”.

We are presenting a “complete” example in the code window below. Feel free to click around and explore! We will be explaining what everything does during this course.

redux tutorial about Redux: The Single Immutable State Tree

Redux: The Single Immutable State Tree

2:11 redux

How is Redux different from Backbone or Flux? Learn the first principle of Redux—the single immutable state tree.

We are presenting a “complete” example in the code window below. Feel free to click around and explore! We will be explaining what everything does during this course.

javascript tutorial about Intro to Recursion - The Solution

Intro to Recursion - The Solution

4:39 javascript PRO

In this lesson we manage to remove all of the nested loops that helped us towards a partial solution in the first lesson. We create a function getTasks, that can, only under certain conditions, call itself. This is the basis of recursion and often leads to cleaner, shorter code that can handle more dynamic input.

javascript tutorial about Intro to Recursion - The Problem

Intro to Recursion - The Problem

6:15 javascript PRO

Recursion is a technique well suited to certain types of tasks. In this first lesson we’ll look at solving a problem that requires the flattening of arrays without using recursion. Showing the shortcoming of a non-recursive solution first will help you to understand why it’s so valuable and why sometimes it's the only solution to many problem.

javascript tutorial about Chaining Web Audio Nodes

Chaining Web Audio Nodes

6:27 javascript PRO

In this lesson, we learn about a couple of new types of nodes and see how to chain multiple nodes together to create various special effects.

javascript tutorial about Converting an array-like object into an Array with Array.from()

Converting an array-like object into an Array with Array.from()

2:19 javascript PRO

Array.from() lets you convert an "iterable" object (AKA an array-like object) to an array. In this lesson, we go over grabbing DOM nodes and turing them into an array so that we can use methods like Array.filter() and Array.forEach() on them.

javascript tutorial about Intro to the Web Audio API

Intro to the Web Audio API

4:34 javascript PRO

An introduction to the Web Audio API. In this lesson, we cover creating an audio context and an oscillator node that actually plays a sound in the browser, and different ways to alter that sound.

javascript tutorial about Sort an Array Alphabetically or Numerically

Sort an Array Alphabetically or Numerically

6:23 javascript PRO

Sort can automatically arrange items in an array. In this lesson we look at the basics including how to sort an array of strings alphabetically and the correct way to perform a numerical sort on an array of numbers. We finish as always with a practical use-case that shows not only sort in action, but also how it can be chained together with other array methods such as map and join.

javascript tutorial about Learn to Flatten and Flatmap Arrays with Reduce

Learn to Flatten and Flatmap Arrays with Reduce

8:06 javascript PRO

Learn a few advanced reduction patterns: flatten allows you to merge a set of arrays into a single array, the dreaded flatmap allows you to convert an array of objects into an array of arrays which then get flattened, and reduceRight allows you to invert the order in which your reducer is applied to your input values.

javascript tutorial about Avoid Common Mistakes when Working with Reduce

Avoid Common Mistakes when Working with Reduce

4:17 javascript PRO

In this lesson, we will be looking at two common mistakes programmers make when working with reduce. We will see why we always need to pass in an initial value for our accumulator as well as return the accumulator.

javascript tutorial about Use the Optional Reduce Arguments

Use the Optional Reduce Arguments

4:47 javascript PRO

Sometimes we need to turn arrays into new values in ways that can't be done purely by passing an accumulator along with no knowledge about its context. Learn how to reduce an array of numbers into its mathematical mean in a single reduce step by using the optional index and array reducer arguments.

javascript tutorial about Use Reduce to Filter and Map over Large Datasets

Use Reduce to Filter and Map over Large Datasets

8:32 javascript PRO

Learn how two common array functions - map() and filter() - are syntactic sugar for reduce operations. Learn how to use them, how to compose them, and how using reduce can give you a big performance boost over composing filters and maps over a large data set.

css tutorial about JSPM - Loading CSS with JSPM Plugins

JSPM - Loading CSS with JSPM Plugins

2:22 css PRO

JSPM is a JavaScript Package Manager, but it can also install and load other file types such as CSS using plugins. This lesson demonstrates how to install twitter's bootstrap library and then load it into your project.

javascript tutorial about Reduce an Array into a Single Object

Reduce an Array into a Single Object

3:59 javascript

We'll look at using array.reduce to transform an array of strings into an object that counts the occurrence of each string in the array.

javascript tutorial about Transform an Array into a Single Value using Reduce

Transform an Array into a Single Value using Reduce

3:56 javascript

Learn how to use the reduce function on javascript arrays to transform a list of values into something else. In this introduction we'll be taking a list of numbers and reducing them into a sum.

immutable tutorial about Immutable.Record() as data models

Immutable.Record() as data models

5:33 immutable PRO

The Immutable.js Record() allows you to model your immutable data much like you would model data with native Javascript classes or objects. It differs from native classes because it cannot be mutated after it's creation and it always has a default value. It's an excellent construct in which to piece together your stores, be them Flux or some other storage implementation. Let's quickly create an Immutable Record().

immutable tutorial about Lightning Fast Immutable.js Equality Checks with Hash Codes

Lightning Fast Immutable.js Equality Checks with Hash Codes

2:27 immutable PRO

While Immutable.js offers .is() to confirm value equality between iterables it comes at the cost of referencing each key and value in both objects. For lightning fast equality checks, Immutable.js can produce a hash code based on an iterable's content. If two iterables have the same content, their hash codes will be the same. It's worth noting that this technique is unsuitable for mission critical application development since there is a chance, however slight, that checksums like these might collide. This is outlined here: https://en.wikipedia.org/wiki/Collision_(computer_science)

immutable tutorial about Transforming Immutable Data with Reduce

Transforming Immutable Data with Reduce

8:25 immutable PRO

Immutable.js iterables offer the reduce() method, a powerful and often misunderstood functional operator on which map(), filter(), groupBy(), etc. are built. The concept is simple: reduce transforms your iterable into something else, that's all. The name is misleading as you may or may not actually "reduce" anything. Let's replicate the groupBy() and filter() methods with reduce to illustrate how it works.

immutable tutorial about Maintaining Order in Immutable.js Objects

Maintaining Order in Immutable.js Objects

8:08 immutable PRO

Immutable.js's Map doesn't promise iteration order after a set() operation. When we need a guarantee for iteration order, we can use OrderedMap. This comes at a slight performance cost, or for you computer science people, it is amortized at an unstable O(log32 N). Let's explore ordering.

immutable tutorial about Simple Undo/Redo with Immutable.js Data Structures

Simple Undo/Redo with Immutable.js Data Structures

8:35 immutable PRO

Implementing Undo/Redo can be tricky business. Consider two strategies to simplify implenting undo/redo: 1) use immutable data 2) react to that data with a top-down approach. Let's build a simple drawing app that will draw circles on a canvas and allow us to undo/redo our drawing.

immutable tutorial about Converting Immutable.js Structures to Javascript and other Immutable Types

Converting Immutable.js Structures to Javascript and other Immutable Types

5:57 immutable PRO

Immutable.js provides several conversion methods to migrate one structure to another. Each Immutable.js class contains a prefixed "to" method like Map.toList(), Map.toSet(), etc. Converting these types sometimes results in a loss of data, as we will see when converting from Map to List.

immutable tutorial about Exploring Sequences and Range() in Immutable.js

Exploring Sequences and Range() in Immutable.js

6:59 immutable PRO

Understanding Immutable.js's Map() and List() structures will likely take you as far as you want to go with immutable programming. They have only small semantic differences between each other and the remaining structures in the Immutable.js family. Sequence, however, has one major difference: it's lazy--which opens a new realm of functional possibilities. Let's write a simple sequence to start.

immutable tutorial about Differences between the Immutable.js Map() and List()

Differences between the Immutable.js Map() and List()

4:02 immutable PRO

The Immutable.js Map() is analogous to a Javascript Object or Hash since it is comprised of key-value pairs. The Immutable.js List() is analogous to a Javascript Array and contains many of the same native methods. Let's compare the two and dive into the basics of List().

immutable tutorial about Using fromJS() to Convert Plain JavaScript Objects into Immutable Data

Using fromJS() to Convert Plain JavaScript Objects into Immutable Data

6:39 immutable PRO

Immutable.js offers the fromJS() method to build immutable structures from objects and array. Objects are converted into maps. Arrays are converted into lists. The fromJS() method can also take a reviver function for custom conversions.

immutable tutorial about Equality Checking with .is() and More

Equality Checking with .is() and More

4:02 immutable PRO

Equality checking deeply nested objects is painful. Fortunately Immutable.js makes this task easy with its .is() and .isSubset() methods. Let's see how we can take two different Immutable Maps() and check for equality.

immutable tutorial about Working with Subsets of an Immutable.js Map()

Working with Subsets of an Immutable.js Map()

7:43 immutable PRO

Immutable.js offers methods to break immutable structures into subsets much like Array--for instance it has the all powerful slice()--and unlike Array it offers functional methods like take() and skip(). You get the best of both the imperative and functional worlds.

immutable tutorial about Iterating Over an Immutable.js Map()

Iterating Over an Immutable.js Map()

6:31 immutable PRO

Immutable.js provides several methods to iterate over an Immutable.Map(). These also apply to the other immutable structures found within the Immutable.js family, such as Set and List. The primary methods are map and forEach, but we will also cover filter and groupBy.

immutable tutorial about Querying an Immutable.js Map()

Querying an Immutable.js Map()

4:47 immutable PRO

Learn how to query an Immutable.Map() using get, getIn, has, includes, find, first and last. These are powerful operators that make finding data in an object graph pain free.

immutable tutorial about Modifying an Immutable.js Map()

Modifying an Immutable.js Map()

5:22 immutable PRO

We will now look at five methods that modify an Immutable.Map(). I highly encourage you to visit the Immutable.js documentation where I am now. They are set, delete, clear, update and merge. These are used often, so let's get to know them well.

immutable tutorial about Creating an Immutable Object Graph with Immutable.js Map()

Creating an Immutable Object Graph with Immutable.js Map()

3:15 immutable PRO

Learn how to create an Immutable.Map() through plain Javascript object construction and also via array tuples.

immutable tutorial about Manage Application State with Immutable.js

Manage Application State with Immutable.js

2:36 immutable

Learn how Immutable.js data structures are different from native iterable Javascript data types and why they provide an excellent foundation on which to build your application's state.

javascript tutorial about Using JSHint for Linting with Gulp

Using JSHint for Linting with Gulp

6:01 javascript PRO

We will look at linting your JavaScript files using jsHint with Gulp to check for errors and warnings.

javascript tutorial about Understanding function bind() in JavaScript

Understanding function bind() in JavaScript

3:03 javascript PRO

Changing context in JavaScript is only possible using call() and apply(). The bind() method on the function prototype use those methods to allow us to quickly change the context in which a function is executed in. Learn how bind works by recreating it.

javascript tutorial about Create a Shallow Copy of an Array with Slice

Create a Shallow Copy of an Array with Slice

9:15 javascript PRO

Array slice creates a shallow copy of an array. In this lesson we cover, in detail, exactly what a 'shallow' copy is and how it can trip people up. We go on to look at examples that show to how to copy only the first item, the last item and even how to copy a sub-section of an array excluding the first and last. We end the lesson with a practical example that shows how slice fits into a workflow that contains other array methods such as map & reduce.

javascript tutorial about Check if a Value is in an Array with indexOf

Check if a Value is in an Array with indexOf

5:21 javascript PRO

indexOf is used to search for a value or reference inside of an array. In this lesson we first look at what values are returned when a search is successful vs when it's unsuccessful. Then we move onto a technique that shows how to use the return value to create a boolean flag that can be checked easily. We end by filtering 1 array based on the existence of a value in a whitelist array.

javascript tutorial about Combine Values of an Array into a String with Join

Combine Values of an Array into a String with Join

4:42 javascript PRO

The join() method joins all elements of an array into a string. In this lesson we first look at why join is often a better option than regular string concatenation. Then we move onto an example which shows a simple way of storing lines of text in an array and outputting them with a new line separator and we finish by looking at ways to chain multiple array methods together.

javascript tutorial about Use Concat to Add Values to an Array

Use Concat to Add Values to an Array

4:38 javascript

Concat creates a shallow copy of an existing array that includes any arguments you pass to it. In this lesson, we look at using concat for adding additional values to an array then cover some more useful features such as accepting other arrays as arguments & how to chain concat with other array methods such as forEach

jspm tutorial about An Introduction to JSPM (JavaScript Package Manager)

An Introduction to JSPM (JavaScript Package Manager)

3:09 jspm PRO

JSPM can handle installed packages, transpiling ES6, and bundling all from the command-line. This video gives a quick overview of install JSPM, installing packages with JSPM, writing a very simple app in ES6 that uses those packages, then bundling up for production.

javascript tutorial about const Declarations in es6 (ES2015)

const Declarations in es6 (ES2015)

2:14 javascript PRO

Read only variables are available in JavaScript (es6/es2015). We will use const declarations and their benefits, like read only and block scope.

gulp tutorial about Gulp and Browserify - Adding Babel & Source Maps

Gulp and Browserify - Adding Babel & Source Maps

4:30 gulp PRO

What is already a nice workflow using Gulp, Browserify, Watchify & Browsersync to enable auto rebuilds & live browser reloading can be further improved by adding Babelify. A simple wrapper around the popular transpiler Babel, Babelify can ‘transform’ source files as they pass through our stream to enable certain Javascript features not yet available in the Browser or Node. We end the lesson by looking at how to generate & extract sourcemaps using exorcist.

browserify tutorial about Gulp and Browserify - Adding Live Reload with Browsersync

Gulp and Browserify - Adding Live Reload with Browsersync

3:08 browserify PRO

Building upon the watch task that we begin this lesson with, we’ll look at how to create a local development server using the app directory as the web root. By using Browsersync to achieve this, we can also instruct all connected browsers to automatically reload each time our bundle is re-generated. Browsersync has a public .stream() method that is designed exactly for this purpose.

browserify tutorial about Gulp and Browserify - Hooking up Watchify

Gulp and Browserify - Hooking up Watchify

3:31 browserify PRO

Beginning with a single Gulp task capable of generating a one-time Browserify bundle, we enable file-watching and incremental rebuilds by incorporating Watchify. We add a second task watch & refactor our initial code to enable the bulk of it to be re-used. We’ll look at exactly how to ‘wire’ these tools together and how the relationship between Watchify & Browserify can manifest into a seriously efficient workflow.

gulp tutorial about Gulp and Browserify - Initial Setup

Gulp and Browserify - Initial Setup

2:21 gulp PRO

Let's look at the basics of setting up Gulp and Browserify. Creating a Gulp task from scratch, we'll cover how to utilise the Browserify API to generate a single bundle.js file, catch and log any errors that occur in the compilation process, transform the stream into a format that can be consumed by gulp.dest and finish by writing the bundle to a dist directory.

javascript tutorial about Limit Built Branches on Travis

Limit Built Branches on Travis

3:38 javascript

By default, Travis will build all branches, tags, and Pull Requests. Because we're building our master branch before we release, we don't need Travis building our releases. Also, we don't care to have Travis build all the branches. So we're going to limit Travis to only build our master branch and Pull Requests by configuring travis via our .travis.yml file.

javascript tutorial about Adding ES6 Support to Tests using Mocha and Babel

Adding ES6 Support to Tests using Mocha and Babel

5:02 javascript

By adding ES6 support to our source code, we need to add that same support to our tests so we can consume that synatx. This is quite easy with the --compilers flag for Mocha.

HEY, QUICK QUESTION!
Joel's Head
Why are we asking?