Created
January 5, 2017 20:33
-
-
Save casprwang/915d1d53abf17b387651ae03b66daa23 to your computer and use it in GitHub Desktop.
comment is a verbose function
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
// const barker = (state) => | |
// const barker = state => ({ | |
// bark: () => console.log(`Woof, I am ${state.name}`) | |
// }); | |
const barker = state => ({ | |
bark: () => console.log(`Woof, I am an ${state.name}`) | |
}); | |
// const barker = ()=> { | |
// return { | |
// bark: () => console.log(`Woof, I am an ${state.name}`) | |
// } | |
// } | |
const driver = state => ({ | |
drive: () => state.position += state.speed | |
}); | |
barker({ name: 'karo' }).bark(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment