Skip to content

Instantly share code, notes, and snippets.

View shoebsd31's full-sized avatar
:octocat:

shoeb shoebsd31

:octocat:
View GitHub Profile
@shoebsd31
shoebsd31 / flatMap.js
Created December 21, 2017 15:10 — forked from samgiles/flatMap.js
Javascript flatMap implementation
// [B](f: (A) ⇒ [B]): [B] ; Although the types in the arrays aren't strict (:
Array.prototype.flatMap = function(lambda) {
return Array.prototype.concat.apply([], this.map(lambda));
};