Last active
April 3, 2018 12:16
-
-
Save indongyoo/4ea5e0934a42e1066419fb4afb6ffad4 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const { map } = Functional; | |
console.log( map(a => a + 1, [1, 2]) ); | |
// [2, 3] | |
console.log( map(a => a + 1, {a: 1, b: 2}) ); | |
// {a: 2, b: 3} | |
console.log( map(a => a + 1, new Map([['a', 1], ['b', 2]])) ); | |
// Map(2) {"a" => 2, "b" => 3} | |
console.log( map(a => a + 1, Promise.resolve(1)) ); | |
// Promise {<resolved>: 2} | |
const f = map(a => a + 1, _=> 1); | |
console.log(f); | |
// (..._) => f(coll(..._)) | |
console.log(f()); | |
// 2 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment