Skip to content

Instantly share code, notes, and snippets.

View ninjabiscuit's full-sized avatar

Andrew Walker ninjabiscuit

  • Intercom
  • London
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)
@callum
callum / example.js
Last active December 29, 2015 02:09
var getData = new JSONPInterface();
function callback(data) {
}
getData("http://example.com/?callback=", callback);
if (typeof Object.create !== "function")
Object.create = function (o) {
function F() {}
F.prototype = o;
return new F();
};
var Model = {
prototype: {
init: function(){}