Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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
You can’t perform that action at this time.