Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function behavior(config) {
- return function () {
- if (config.verbose) {
- console.log('I AM SCREAMING!');
- } else {
- console.log('i am a bit more polite');
- }
- }
- }
- var talk = behavior({verbose: true});
- talk();
- --------------------------------------------
- function behavior2(config) {
- if (config.verbose) {
- console.log('I AM SCREAMING!');
- } else {
- console.log('i am a bit more polite');
- }
- }
- var talk = behavior2.bind(null, {verbose: true});
- talk();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement