Skip to content

Instantly share code, notes, and snippets.

@Sgeo
Created November 20, 2014 08:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Sgeo/bc7722305fb3378e28db to your computer and use it in GitHub Desktop.
Save Sgeo/bc7722305fb3378e28db to your computer and use it in GitHub Desktop.
Corrected version of @HeadDZombie demethodize based on spread syntax
var demethodize = function(func) {
"use strict";
return function(...args) {
func.apply(args[0], args.slice(1))
};
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment