Last active
December 12, 2015 10:18
-
-
Save anvaka/4757667 to your computer and use it in GitHub Desktop.
Just having fun... This function prints itself to the console.
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
(function () { | |
var arr = ["(function () {", "var arr = [", "arr[1] += arr.map(function(x) { return String.fromCharCode(0x22) + x + String.fromCharCode(0x22); }).join(', ') + '];';", "arr.forEach(function(x) { console.log(x); });", "}())"]; | |
arr[1] += arr.map(function(x) { return String.fromCharCode(0x22) + x + String.fromCharCode(0x22); }).join(', ') + '];'; | |
arr.forEach(function(x) { console.log(x); }); | |
}()) |
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
(function quine() { console.log('(' + quine.toString() + '())'); }()) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment