Skip to content

pedroapfilho/array-methods

Folders and files

NameName
Last commit message
Last commit date

Latest commit

2d726df · Jul 17, 2020

History

20 Commits
Jan 20, 2019
Jun 5, 2019
Aug 27, 2019
Jan 20, 2019
Jun 30, 2019
Jul 17, 2020
Jul 17, 2020

Repository files navigation

Array Methods

A table of array methods for reference

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

Here are some examples

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