Created
May 11, 2016 18:40
-
-
Save jkusachi/944e27da89d33f1364c323fbe528f761 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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