DEV Community

Lawrence malachi
Lawrence malachi

Posted on

JavaScript Array Methods You Should Know

  1. Map
    purpose: Transform every item in an array, and return's a new array.

  2. Filter
    filter select items that meet a condition, and return's the new array.

3.Reduce
reduce combine multiple value into one result, and return one value.

  1. Find
    It find's the first item that meet a condition, and return's the item or undefined.

  2. Sort
    sort arranges items in a particular order, and return's the sorted array.

Easy way to remember:
map - Transform
filter - select many
find - find one
reduce - combine
sort - arrange

Top comments (0)