brinley / high-order-functions

Just a reminder on how to use high order functions

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

High Order Functions

Just a table of high order functions for reference

Function 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 return all the array find.js
.forEach() forEach runs on each object on the array and do 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

Function 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

About

Just a reminder on how to use high order functions


Languages

Language:JavaScript 100.0%