Created
July 16, 2013 19:38
-
-
Save wetmore/6011927 to your computer and use it in GitHub Desktop.
node.js quine (inspired by the java example on wikipedia)
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 quote = String.fromCharCode(39); | |
var source = [ | |
'var quote = String.fromCharCode(39);', | |
'var source = [', | |
' ', | |
'];', | |
'console.log(source[0]);', | |
'console.log(source[1]);', | |
'source.forEach(function(line) {', | |
' console.log(source[2] + quote + line + quote + ",");', | |
'});', | |
'source.slice(3).forEach(function(line) {', | |
' console.log(line);', | |
'});' | |
]; | |
console.log(source[0]); | |
console.log(source[1]); | |
source.forEach(function(line) { | |
console.log(source[2] + quote + line + quote + ","); | |
}); | |
source.slice(3).forEach(function(line) { | |
console.log(line); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment