Skip to content

Instantly share code, notes, and snippets.

@adatta02
Created January 3, 2018 03:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save adatta02/dedc79c9252aec5abda5134c7d8d69ec to your computer and use it in GitHub Desktop.
Save adatta02/dedc79c9252aec5abda5134c7d8d69ec to your computer and use it in GitHub Desktop.
function partial(fn /*, rest args */){
return fn.bind.apply(fn, Array.apply(null, arguments).slice(1));
}
const Logger = {
log(level, dateFormat, msg) {
console.log(level, dateFormat, msg);
}
};
const info = partial(Logger.log, "info", "ISO8601");
info("Application started");
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment