flip should only reverse the first two arguments
Closed this issue · 0 comments
ericelliott commented
flip :: (a -> b -> c) -> b -> a -> c
Wouldn't this implementation reverse the args instead of flip the first two?
function flip (f) {
return (...args) => f(...args.reverse());
}
const foo = (a, b, c) => [a, b, c];
const test = flip(foo); // ['c', 'b', 'a'] -- should return ['b','a','c']