Skip to content

Instantly share code, notes, and snippets.

@jkusachi
Created May 11, 2016 18:40
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 jkusachi/944e27da89d33f1364c323fbe528f761 to your computer and use it in GitHub Desktop.
Save jkusachi/944e27da89d33f1364c323fbe528f761 to your computer and use it in GitHub Desktop.
var data = {
name: 'james',
age: 30
};
function doSomething(){
console.log('- doSomething');
return (...args) => {
console.log('- whatever you want');
saySomething(...args);
}
}
function saySomething(...args){
var {name, age} = args[0];
console.log('- saySomething');
console.log(`-- Name: ${name}`);
console.log(`-- Age: ${age}`);
}
var makeSomething = doSomething();
makeSomething(data);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment