Skip to content

Latest commit

 

History

History

reduce-method

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 

JavaScript - Reduce method

Reduce is one of the methods to traverse the arrays.

It will be used to return the reduced single value of the array.

It will take callback and a default value of the accumulator as input.

  • Syntax:
    const value = Array.reduce((accumulator, elementOfArray) => {
        return // value;
    }, defaultValueForAccumulator);