Reduce Data with Javascript Array#reduce

48 minutes

Most examples for reduce show you how to take an array of numbers and reduce them to a simple sum. Reduce is a great tool for this, but it can do so much more. It is a powerful tool, and essential to functional programming techniques.

This course will dig deep into the Array#reduce in JavaScript and give you a solid understanding to start using it today.

pro-course-rss-logo

PRO RSS Feed

Introducing Reduce: Transforming Arrays Functionally

Introducing Reduce: Reducing an Array into an Object

Introducing Reduce: Common Patterns

Advanced Reduce: Additional Reducer Arguments

P

Advanced Reduce: Common Mistakes

P

Advanced Reduce: Flatten, Flatmap and ReduceRight

P

Advanced Reduce: Composing Functions with Reduce

P

Advanced Reduce: Safe Nested Object Inspection

P
js tutorial about Introducing Reduce: Transforming Arrays Functionally

Introducing Reduce: Transforming Arrays Functionally

3:56 js

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.

js tutorial about Introducing Reduce: Reducing an Array into an Object

Introducing Reduce: Reducing an Array into an Object

3:59 js

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.

js tutorial about Introducing Reduce: Common Patterns

Introducing Reduce: Common Patterns

8:32 js

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.

js tutorial about Advanced Reduce: Additional Reducer Arguments

Advanced Reduce: Additional Reducer Arguments

4:47 js 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.

js tutorial about Advanced Reduce: Common Mistakes

Advanced Reduce: Common Mistakes

4:17 js PRO

A programmer left her accumulator's initial value undefined - you won't believe what happened next!

js tutorial about Advanced Reduce: Flatten, Flatmap and ReduceRight

Advanced Reduce: Flatten, Flatmap and ReduceRight

8:06 js 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.

js tutorial about Advanced Reduce: Composing Functions with Reduce

Advanced Reduce: Composing Functions with Reduce

8:19 js PRO

Learn how to use array reduction to create functional pipelines by composing arrays of functions.

js tutorial about Advanced Reduce: Safe Nested Object Inspection

Advanced Reduce: Safe Nested Object Inspection

6:29 js PRO

A common problem when dealing with some kinds of data is that not every object has the same nested structure. lukeskywalker.parents.father.isjedi works, but anakinskywalker.parents.father.isjedi throws an exception, because anakin_skywalker.parents.father is undefined. But we can reduce a path to provide safe default values and avoid exceptions when walking the same path on non-homogenous objects - watch to learn how! :)

Presented by:

mykola bilokonsky

Myk writes codes, flies drones, and spends too much time thinking about consciousness.

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