Skip to content

Instantly share code, notes, and snippets.

View aksrikanth's full-sized avatar
💭
Moved to gitlab.com/aksrikanth

Srikanth Agaram aksrikanth

💭
Moved to gitlab.com/aksrikanth
View GitHub Profile
@bendc
bendc / functional-utils.js
Last active September 15, 2023 12:12
A set of pure 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)