Skip to content

Instantly share code, notes, and snippets.

@christianscott
Created March 8, 2018 01:00
Show Gist options
  • Save christianscott/8b8a9a34557161636c2cc97cb855cbc8 to your computer and use it in GitHub Desktop.
Save christianscott/8b8a9a34557161636c2cc97cb855cbc8 to your computer and use it in GitHub Desktop.
Flip the order of arguments for a function in Javascript
function flip(fn) {
return function () {
return fn.apply(null, Array.prototype.reverse.call(arguments))
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment