Skip to content

Instantly share code, notes, and snippets.

View hugoclrd's full-sized avatar
👋

Hugo C hugoclrd

👋
  • France
  • 02:20 (UTC +01:00)
View GitHub Profile
@bendc
bendc / functional-utils.js
Last active July 15, 2025 04:33
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)