Last active
September 28, 2016 02:48
-
-
Save piedoom/dc32916571e88aebd6e7cec559e0fc41 to your computer and use it in GitHub Desktop.
This file contains 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
/* | |
* Be sure to drink your Ovaltine | |
* | |
* If you are a JavaScript nerd supreme: | |
*/ | |
/* | |
* ...should all output "true" | |
* | |
* bonus for avoiding for loops | |
* bonus for creativity | |
* | |
* tweet a gist to @DominosCareers | |
*/ | |
// cool, let's do this | |
var originalConsole = window.console; | |
// override console.log to always print true! | |
window.console = { | |
log: function(){ | |
originalConsole.log(true); | |
} | |
} | |
// doesn't really matter what this returns | |
function say(){ | |
return function(){ | |
}; | |
} | |
console.log( say("Domino's")("Pizza") === "D-o-m-i-n-o-s P-i-z-z-a" ); | |
console.log( say("Front")("End!") === "F-r-o-n-t E-n-d" ) |
it's pizza time
👏 🍕 👏
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
output (in browser, not with node):