Last active
March 27, 2016 14:49
-
-
Save mshustov/3d66c32265bdc46ca2ee 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 hello = 'hello'; | |
var world = 'world'; | |
var mark = '!'; | |
var options = { | |
silent: true | |
}; | |
function greet(options, first, second){ | |
if (options.silent){ | |
return '...'; | |
} | |
var local = [first, second, mark].join(' '); | |
return local | |
} | |
greet = greet.bind(null, options); | |
['Alice', 'John'].forEach(function(name){ | |
console.log(name, 'said:', greet(hello, world)); | |
}) |
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 hello = 'hello'; | |
var world = 'world'; | |
var mark = '!'; | |
var options = { | |
silent: true | |
}; | |
function greet(options, first, second){ | |
if (options.silent){ | |
return '...'; | |
} | |
var local = [first, second, mark].join(' '); | |
return local | |
} | |
greet = greet.bind(null, options); | |
['Alice', 'John'].forEach(function(name){ | |
console.log(name, 'said:', greet(hello, world)); | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment