Browse all JavaScript lessons.

showing All 474 lessons...

Filter an Array Based on Multiple Predicates with Ramda's allPass Function

Using Text to Speech with NativeScript

Convert Object Methods into Composable Functions with Ramda

Sort an Array of Objects by Multiple Fields with Ramda's sortWith

Refactor a Promise Chain to Function Composition using Ramda

Refactor to a Point Free Function with Ramda's useWith Function

Debug Function Compositions with Ramda's Tap Function

Get a List of Unique Values From Nested Arrays with Ramda

Create an Array From a Seed Value with Ramda's unfold

Create a "Hello World" app using Electron

Handle Errors in Ramda Pipelines with tryCatch

Use the Exponentiation Operator in JavaScript

Check if an array contains an item using Array.prototype.includes

Convert a callback to a promise

Refactor to Point Free Functions with Ramda using compose and converge

Eliminate Function Arguments (Point-Free Style) with Ramda's Converge

Count Words in a String with Ramda's countBy and invert

Identify and Deal with NaN in JavaScript

Format console.log with CSS and String Template Tags

Convert a QueryString to an Object using Function Composition in Ramda

Create Streams From Iterables With Most.js

Declaratively Map Data Transformations to Object Properties Using Ramda evolve

Public Class Fields with React Components

Select a Subset of Properties from a Collection of Objects in Ramda

Use ES6 Proxies

Curry and Uncurry Functions with Ramda

Create Streams From Single Values With Most.js

Combine Objects with Object.assign and Lodash merge

Set up a native app project with the NativeScript CLI

Add user interaction to Ember.js apps using actions

Include spell-check in text projects using Natural

Check if words sound alike using Natural

Search more efficiently with tries using Natural

Compare similarity of strings through string distance in Natural

Using machine learning classifiers in a new project

Identify the most important words in a document using tf-idf in Natural

Find a word’s definition using WordNet in Natural

Classify text into categories with machine learning in Natural

Classify JSON text data with machine learning in Natural

Tag parts of speech using Natural

Find sequences of words (n-grams) using Natural

Pluralizing nouns and counting numbers with inflectors in Natural

Find the roots of words using stemming in Natural

Create a list with nested reduce functions in ImmutableJS

Use GraphQL's Object Type for Basic Types

P

Create a GraphQL Schema

Use Relay’s Input Object Mutations

P

Convert GraphQL List Type to a Relay Connection Type

P

Add a Relay Node Interface to a GraphQL Schema

P

Add an Interface to a GraphQL Schema

P
js tutorial about Filter an Array Based on Multiple Predicates with Ramda's allPass Function

Filter an Array Based on Multiple Predicates with Ramda's allPass Function

2:24 js

In this lesson, we'll filter a list of objects based on multiple conditions and we'll use Ramda's allPass function to create a joint predicate from multiple, individual predicate functions.

js tutorial about Using Text to Speech with NativeScript

Using Text to Speech with NativeScript

3:16 js

We will use the NativeScript Text-to-Speech plugin to have the iOS and Android speech synthesizers speak a provided text.

js tutorial about Convert Object Methods into Composable Functions with Ramda

Convert Object Methods into Composable Functions with Ramda

4:44 js

In this lesson, we'll look at how we can use Ramda's invoker and constructN functions to take methods of an object and turn them into reusable utility functions that are curried and accept their object as the last argument. We'll convert a dot-chained string of jQuery methods and create a composed function that can be applied to multiple elements.

js tutorial about Sort an Array of Objects by Multiple Fields with Ramda's sortWith

Sort an Array of Objects by Multiple Fields with Ramda's sortWith

1:58 js

Sorting an array of objects by multiple fields can be tricky. Even worse, the code can be tough to follow and making changes in the future is complicated by conditional logic in the sorting function. In this lesson we'll see how to simplify this using Ramda's sortWith along with ascending and descending. We'll sort an array of objects by multiple fields and the code will be readable and dead simple to change.

js tutorial about Refactor a Promise Chain to Function Composition using Ramda

Refactor a Promise Chain to Function Composition using Ramda

8:37 js

Promise chains can be a powerful way to handle a series of transformations to the results of an async call. In some cases, additional promises are required along the way. In cases where there are no new promises, function composition can reduce the number of dot chained thens you need. In this lesson, we'll look at how to take a promise chain, and reduce it down with function composition.

js tutorial about Refactor to a Point Free Function with Ramda's useWith Function

Refactor to a Point Free Function with Ramda's useWith Function

3:41 js

Naming things is hard and arguments in generic utility functions are no exception. Making functions "tacit" or "point free" removes the need for the extra parameter names and can make your code cleaner and more succinct. In this lesson, we'll create a normal, "pointed" function and then use ramda's useWith function to refactor our way to point-free bliss.

js tutorial about Debug Function Compositions with Ramda's Tap Function

Debug Function Compositions with Ramda's Tap Function

2:48 js

Functional composition is a great way to write declarative code that reads well. But sometimes, you need to get insight into what's happening at different steps in your composition. This is where tap comes in. With tap, we can run code that generates side-effects, like logging to the console, and our data will continue to be passed along, untouched.

js tutorial about Get a List of Unique Values From Nested Arrays with Ramda

Get a List of Unique Values From Nested Arrays with Ramda

5:55 js

In this lesson, we'll grab arrays of values from other arrays, resulting in a nested array. From there, we'll look at multiple ways to flatten the array structure using composition with map and unnest and then refactoring to use chain, AKA flatMap. Finally, we'll add Ramda's uniq function to remove duplicate values.

js tutorial about Create an Array From a Seed Value with Ramda's unfold

Create an Array From a Seed Value with Ramda's unfold

3:05 js

In this lesson we'll look at how you can use Ramda's unfold function to generate a list of values based on an initial seed.

js tutorial about Create a "Hello World" app using Electron

Create a "Hello World" app using Electron

2:18 js

Take the first step in learning how to create native desktop applications with Electron. We'll set up a package.json, create an npm start script to launch our app in development, and create a browser window and load a local HTML file into it.

An important concept to understand about Electron is it's multi-process architecture. The main process creates web pages by creating BrowserWindow instances, manages application lifecycle events, and more. Each BrowserWindow instance runs the web page in its own renderer process.

js tutorial about Handle Errors in Ramda Pipelines with tryCatch

Handle Errors in Ramda Pipelines with tryCatch

2:32 js

Handling your logic with composable functions makes your code declarative, leading to code that's easy to read and easy to test. Breaking that up to wrap some risky function in a try/catch block introduces imperative code and makes it harder to maintain that declarative approach. With Ramda's tryCatch function, you can handle errors right in the middle of a composition and leave your code clean and functional. We'll also see how you can use propOr to avoid common "cannot find X of undefined" errors.

js tutorial about Use the Exponentiation Operator in JavaScript

Use the Exponentiation Operator in JavaScript

3:30 js

ES2016 introduced the exponentiation operator ** to JavaScript. This lesson shows how it works and how you can use it as a replacement for the Math.pow function.

js tutorial about Check if an array contains an item using Array.prototype.includes

Check if an array contains an item using Array.prototype.includes

1:35 js

We often want to check if an array includes a specific item. It's been common to do this with the Array.prototype.indexOf method, but now we have a simpler way: We can use the Array.prototype.includes method, which is available starting with ES2016.

js tutorial about Convert a callback to a promise

Convert a callback to a promise

4:45 js

Promises are rapidly overtaking callbacks in popularity. In this lesson, I show you how to rewrite a callback using ES6 Promises. After getting a handle on the basics, we'll convert an error-first style callback to use the Resolve and Reject handlers built into Promises. If you aren't familiar with Promises, this lesson can be a great starting point by learning how to duplicate the behavior of a callback with ES6 Promises.

js tutorial about Refactor to Point Free Functions with Ramda using compose and converge

Refactor to Point Free Functions with Ramda using compose and converge

3:33 js

In this lesson we'll take some existing code and refactor it using some functions from the Ramda library, most notably, compose and converge. When we're done, we'll have taken a function with a couple of local variables and parameter references and converted it into more streamlined "point-free" or "tacit" functions.

js tutorial about Eliminate Function Arguments (Point-Free Style) with Ramda's Converge

Eliminate Function Arguments (Point-Free Style) with Ramda's Converge

3:47 js

When doing comparisons inside of functions, you end of relying heavily on the argument passed into the function. Ramda's converge allows you to do comparisons in a Point-Free style allowing you more flexibility with composing and constructing functions. This lesson walks through refactoring a function to Point-Free style using Ramda's Converge.

js tutorial about Count Words in a String with Ramda's countBy and invert

Count Words in a String with Ramda's countBy and invert

4:10 js

You can really unlock the power of ramda (and functional programming in general) when you combine functions. Counting words in a string may seem like a relatively difficult task, but ramda makes it easy by providing a countBy function. This lesson walks through using the countBy to count words in a string.

js tutorial about Identify and Deal with NaN in JavaScript

Identify and Deal with NaN in JavaScript

2:12 js

Dealing with the special NaN value can be tricky in JavaScript. It behaves like a number and not a number at the same time. This lesson explains how to identify it using the isNaN function or the Number.isNaN method.

js tutorial about Format console.log with CSS and String Template Tags

Format console.log with CSS and String Template Tags

4:36 js

The Chrome console allows you to format messages using CSS properties. This lesson walks you through the syntax of formatting your logs with css then refactoring into a template tag function to make formatting more reusable.

js tutorial about Convert a QueryString to an Object using Function Composition in Ramda

Convert a QueryString to an Object using Function Composition in Ramda

2:13 js

In this lesson we'll use a handful of Ramda's utility functions to take a queryString full of name/value pairs and covert it into a JavaScript object so we can access those properties in a more useful way. Along the way, we'll build up a composition and look at the tail, split, map and fromPairs functions, along with the crucial compose function.

js tutorial about Create Streams From Iterables With Most.js

Create Streams From Iterables With Most.js

3:59 js

One of the more powerful functions for creating streams in MostJS is the from function.

In this lesson, we use from to create streams from various Javascript Iterables, take a look at how to throw generator functions into the mix and, for good measure, take a sneak peek at how we can limit our streams using a function called take.

As a bonus, we see what it looks like to use Function.prototype.bind for a quick and dirty way to partially apply arguments to a function.

js tutorial about Declaratively Map Data Transformations to Object Properties Using Ramda evolve

Declaratively Map Data Transformations to Object Properties Using Ramda evolve

2:44 js

We don't always control the data we need in our applications, and that means we often find ourselves massaging and transforming our data. In this lesson, we'll learn how to transform objects in a declarative way using ramda's evolve function.

js tutorial about Public Class Fields with React Components

Public Class Fields with React Components

4:52 js

Public Class Fields allow you to add instance properties to the class definition with the assignment operator (=). In this lesson, we'll look at their use case for simplifying event callbacks and state initialization with a React component.

js tutorial about Select a Subset of Properties from a Collection of Objects in Ramda

Select a Subset of Properties from a Collection of Objects in Ramda

2:59 js

In this lesson we'll take an array of objects and map it to a new array where each object is a subset of the original. We'll look at multiple ways to accomplish this, refactoring our code into a simple and easy to read function using Ramda's map, pick and project functions.

js tutorial about Use ES6 Proxies

Use ES6 Proxies

1:32 js

A JavaScript Proxy allows you to intercept operations performed on objects, arrays, or functions like property lookup, assignment, invocation, property deletion, and more to add custom behavior. In this lesson we look at how to intercept property lookup with the get "trap" that will allow us to get items starting from the end of the array with ease.

js tutorial about Curry and Uncurry Functions with Ramda

Curry and Uncurry Functions with Ramda

3:39 js

Most of the functions offered by the ramda library are curried by default. Functions you've created or that you've pulled in from another library may not be curried. Ramda's curry and curryN functions allow you to take a non-curried function and use it as a curried functions. In the case where you have a manually curried function and you want to just call it like a normal function, you can use uncurryN to get back a function that accepts all of the arguments at once.

js tutorial about Create Streams From Single Values With Most.js

Create Streams From Single Values With Most.js

2:01 js

Most provides many means for creating streams, the simplest of which is the of function. In this lesson, we demonstrate the use of of to lift a single value into a stream. We also show off the just alias of of, as well as, a common method for currying a function.

js tutorial about Combine Objects with Object.assign and Lodash merge

Combine Objects with Object.assign and Lodash merge

2:28 js

Learn how to use Object.assign to combine multiple objects together. This pattern is helpful when writing libraries that have a set of default options where you want to allow a user to override specific options. You'll also learn how to use a third party library to recursively merge nested objects together.

js tutorial about Set up a native app project with the NativeScript CLI

Set up a native app project with the NativeScript CLI

2:18 js

NativeScript is a framework that let's you build JavaScript to native applications. In this lesson, we will set up a native app using the NativeScript command-line interface. We will then take a brief look at some of the project it generates.

js tutorial about Add user interaction to Ember.js apps using actions

Add user interaction to Ember.js apps using actions

3:12 js

In Ember.js, functions that are executed through user interaction with your application are called actions, which can be defined at the route, controller, or component level. In this tutorial, we look at a simple example of defining actions on the controller and hooking it up to our template in order to update properties on the controller.

js tutorial about Include spell-check in text projects using Natural

Include spell-check in text projects using Natural

3:05 js

In this lesson, we’ll see how to use Natural’s probabilistic spell-checker, which uses the trie data structure.

js tutorial about Check if words sound alike using Natural

Check if words sound alike using Natural

2:14 js

In this lesson, we’ll take a look at Natural’s phonetics feature. We’ll learn how to check whether two words sound alike, looking at both the SoundEx and Metaphone algorithms.

js tutorial about Search more efficiently with tries using Natural

Search more efficiently with tries using Natural

1:40 js

Tries are a data structure that provide an efficient way to search for the existence of a word or phrase in a body of text, or to search by prefix.

js tutorial about Compare similarity of strings through string distance in Natural

Compare similarity of strings through string distance in Natural

3:32 js

We will learn how to compare how similar two strings are to each other, examining three algorithms: Jaro-Winkler, Levenshtein, and Dice’s Coefficient.

You should note that none of these algorithms are inherently better than the others. Instead, it's important to choose the one that best fits your text data.

js tutorial about Using machine learning classifiers in a new project

Using machine learning classifiers in a new project

2:03 js

By this point we've seen that classification can take a long time, and with more data, it would take even longer. Luckily, Natural provides support to save your classifiers. In this lesson, we will learn how to save a classifier and load it into a new project in order to classify new data.

js tutorial about Identify the most important words in a document using tf-idf in Natural

Identify the most important words in a document using tf-idf in Natural

5:15 js

Tf-idf, or term frequency-inverse document frequency, is a statistic that indicates how important a word is to the entire document. This lesson will explain term frequency and inverse document frequency, and show how we can use tf-idf to identify the most relevant words in a body of text.

js tutorial about Find a word’s definition using WordNet in Natural

Find a word’s definition using WordNet in Natural

2:43 js

This lesson introduces WordNet, which is an important resource in natural language processing. With WordNet, we can look up a word’s definition, or find its synonyms.

js tutorial about Classify text into categories with machine learning in Natural

Classify text into categories with machine learning in Natural

3:42 js

In this lesson, we will learn how to train a Naive Bayes classifier or a Logistic Regression classifier - basic machine learning algorithms - in order to classify text into categories.

js tutorial about Classify JSON text data with machine learning in Natural

Classify JSON text data with machine learning in Natural

6:05 js

In this lesson, we will learn how to train a Naive Bayes classifier and a Logistic Regression classifier - basic machine learning algorithms - on JSON text data, and classify it into categories.

While this dataset is still considered a small dataset -- only a couple hundred points of data -- we'll start to get better results.

The general rule is that Logistic Regression will work better than Naive Bayes, but only if there is enough data. Since this is still a pretty small dataset, Naive Bayes works better here. Generally, Logistic Regression takes longer to train as well.

This uses data from Ana Cachopo: http://ana.cachopo.org/datasets-for-single-label-text-categorization

js tutorial about Tag parts of speech using Natural

Tag parts of speech using Natural

2:16 js

An important component of many natural language processing projects is being able to identify the grammar of a piece of text. We’ll learn how to do that with Natural’s parts of speech (POS) tagger.

There are many tags, and it's worth looking them up online (search "POS tag symbols") to become familiar with them all.

The setup of the tagger may seem a little strange, but it allows you to replace the lexicon or the rules with a different lexicon or rule set of your choice.

js tutorial about Find sequences of words (n-grams) using Natural

Find sequences of words (n-grams) using Natural

2:06 js

N-grams are sequences of words, where the 'n' stands for the number of words in the sequence. In this lesson, we will see how to find bigrams (2-grams), trigrams (3-grams), and any other length n-gram in a body of text.

js tutorial about Pluralizing nouns and counting numbers with inflectors in Natural

Pluralizing nouns and counting numbers with inflectors in Natural

1:06 js

Inflectors are the modifiers of a word that indicate grammatical categories. While Natural’s coverage of inflectors is not comprehensive, we will show how Natural can pluralize/singularize nouns and count numbers.

js tutorial about Find the roots of words using stemming in Natural

Find the roots of words using stemming in Natural

1:33 js

We will learn about “stemming,” the process of finding the root of words, often in order to group words by a common base root. We will look at the Porter and Lancaster Stemmers, briefly touch on Natural’s support for Russian and Spanish stemmers, and introduce the function to stem and tokenize at the same time.

js tutorial about Create a list with nested reduce functions in ImmutableJS

Create a list with nested reduce functions in ImmutableJS

1:30 js

ImmutableJS reduce functions can be nested to get data out of complex data structures. In this example, we will create an Immutable List from an Immutable Map that is nested inside of an Immutable List that is itself nested inside of an Immutable Map.

js tutorial about Use GraphQL's Object Type for Basic Types

Use GraphQL's Object Type for Basic Types

2:13 js PRO

We can create the most basic components of our GraphQL Schema using GraphQL's Object Types. These types allow us to group related fields together under a specific type, such as a Video or a User, and then allows us to fetch these types when we query our schema. In this video, we'll learn how to write GraphQL Object Types in GraphQL's Schema language, as well as how to create resolvers for them, and ultimately how to query them.

js tutorial about Create a GraphQL Schema

Create a GraphQL Schema

4:16 js

In this video, we’ll take a look at the GraphQL Language and write out our first GraphQL Schema. We’ll use the graphql package available to us through npm to parse our graphql language file and resolve our initial query.

js tutorial about Use Relay’s Input Object Mutations

Use Relay’s Input Object Mutations

4:59 js PRO

In order to support mutations in Relay, there is a requirement that the GraphQL Server exposes mutation fields in a standardized way. This standard includes a way for mutations to accept and emit an identifier string, allowing Relay to track mutations and responses. In this video, we’ll learn how to use a helper available to us through graphql-relay to create Mutation fields that accept clientMutationId’s.

js tutorial about Convert GraphQL List Type to a Relay Connection Type

Convert GraphQL List Type to a Relay Connection Type

4:12 js PRO

In order to properly traverse through collections, Relay-compliant servers require a mechanism to page through collections available in a GraphQL Schema. In this video, we’ll create a Connection type from an existing GraphQL List Type and learn how to access edge information from each collection.

js tutorial about Add a Relay Node Interface to a GraphQL Schema

Add a Relay Node Interface to a GraphQL Schema

7:00 js PRO

The GraphQL Relay Specification requires that a GraphQL Schema has some kind of mechanism for re-fetching an object. For typical Relay-compliant servers, this is going to be the Node Interface. In this video, we’ll add in the Node interface to a GraphQL Schema by using the helpers available in the graphql-relay npm package.

js tutorial about Add an Interface to a GraphQL Schema

Add an Interface to a GraphQL Schema

5:18 js PRO

As we start building out more complex GraphQL schemas, certain fields start to repeat across different types. This is a perfect use-case for the Interface Type made available to us through GraphQL’s Type System. In this video, we’ll go over how to create an Interface Type and how to add it to an existing type in a GraphQL Schema.

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