From 7a409ab5dbe949be2910c1eae2eaa20d77220596 Mon Sep 17 00:00:00 2001 From: 30secondsofcode <30secondsofcode@gmail.com> Date: Sun, 28 Jan 2018 14:42:38 +0000 Subject: [PATCH] Travis build: 1477 --- README.md | 2 +- docs/index.html | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 1b93c9293..923e59745 100644 --- a/README.md +++ b/README.md @@ -501,7 +501,7 @@ const Pall = collectInto(Promise.all.bind(Promise)); let p1 = Promise.resolve(1); let p2 = Promise.resolve(2); let p3 = new Promise(resolve => setTimeout(resolve, 2000, 3)); -Pall(p1, p2, p3).then(console.log); +Pall(p1, p2, p3).then(console.log); // [1, 2, 3] (after about 2 seconds) ``` diff --git a/docs/index.html b/docs/index.html index 1abfa80f7..366cc80a2 100644 --- a/docs/index.html +++ b/docs/index.html @@ -66,7 +66,7 @@ Promise.reso let p1 = Promise.resolve(1); let p2 = Promise.resolve(2); let p3 = new Promise(resolve => setTimeout(resolve, 2000, 3)); -Pall(p1, p2, p3).then(console.log); +Pall(p1, p2, p3).then(console.log); // [1, 2, 3] (after about 2 seconds)

flip

Flip takes a function as an argument, then makes the first argument the last.

Return a closure that takes variadic inputs, and splices the last argument to make it the first argument before applying the rest.

const flip = fn => (first, ...rest) => fn(...rest, first);
 
let a = { name: 'John Smith' };
 let b = {};