Skip to content

Instantly share code, notes, and snippets.

View luizbills's full-sized avatar
I may be slow to respond.

Luiz Bills luizbills

I may be slow to respond.
View GitHub Profile
@luizbills
luizbills / functional-utils.js
Created January 13, 2016 01:05 — forked from bendc/functional-utils.js
A set of pure and immutable ES2015 functions aimed to make functional JavaScript more idiomatic.
// array utils
// =================================================================================================
const combine = (...arrays) => [].concat(...arrays);
const compact = arr => arr.filter(Boolean);
const contains = (() => Array.prototype.includes
? (arr, value) => arr.includes(value)
: (arr, value) => arr.some(el => el === value)