Home

Awesome

Array Methods

A table of array methods for reference

MethodWhat it does?Code
.filter()filter receives true/false and only puts the true ones on the arrayfilter.js
.find()it finds the first one that returns true and returns all the arrayfind.js
.forEach()forEach runs on each object on the array and does something with it, it doesn't return anything at allforEach.js
.map()map runs on each object on the array and returns something from itmap.js
.reduce()reduce will take an accumulator first and secondly the value to accumulatereduce.js
.sort()It sorts the array depending on the argumentssort.js

Here are some examples

Method.What it does?Code
Simple SearchWhat if you want to search for more than one argument?simpleSearch.js
Simple BillingWhat if you want to know how much is the billing?simpleBilling.js