curiosity

Watch User Created Playlist (8)

This playlist is user created.

pro-course-rss-logo

PRO RSS Feed

Refactoring: Array.prototype by example [filter, some, forEach]

P

Intro to Recursion - The Solution

P

CSS :target Selector

P

Use ES6 Proxies

P

Partial Application with Function.bind

P

Intro to Recursion - Refactoring to a Pure Function

P

Intro to Recursion - The Problem

P

What is JavaScript Function Currying?

P
javascript tutorial about Refactoring: Array.prototype by example [filter, some, forEach]

Refactoring: Array.prototype by example [filter, some, forEach]

5:42 javascript PRO

Refactoring is a great opportunity to learn and we have an existing Javascript function that is lengthy, hard to understand, and overcomplicated. We'll take a look at putting some of Javascript's built in Array.prototype methods to use to help us clean this up and learn by example through refactoring.

By taking a few minutes to refactor this existing code, we can get a glimpse at how we can harness the power of the Array and lean on some built in Array functions available to us in Javascript's core without any added utility libraries.

In this lesson we touch on just a few of the Array methods:

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.

css tutorial about CSS :target Selector

CSS :target Selector

1:52 css PRO

The :target selector allows us to interact with a fragment identifier, or hash, in our URL from CSS.

javascript tutorial about Use ES6 Proxies

Use ES6 Proxies

1:32 javascript PRO

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.

javascript tutorial about Partial Application with Function.bind

Partial Application with Function.bind

3:24 javascript PRO

Function.bind is useful for more than locking down the this context when calling a function. This lesson shows how Function.bind can be used to make a new function with pre-specified initial arguments. This is a simple example of a functional programming technique called partial application which allows the remaining arguments to be specified when the new function is called.

javascript tutorial about Intro to Recursion - Refactoring to a Pure Function

Intro to Recursion - Refactoring to a Pure Function

3:37 javascript PRO

Our previous solution used forEach and a globally available array that could be mutated from inside our function. We can improve upon this and create a function that is easier to maintain & test by swapping our forEach loop for reduce. By removing the global array and instead making getTasks return a value directly we end up with a pure function.

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 What is JavaScript Function Currying?

What is JavaScript Function Currying?

5:34 javascript PRO

Currying is a core concept of functional programming and a useful tool for any developer's toolbelt. In this lesson, John walks through the definition of currying and its practical usage.

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