Last active
August 29, 2015 14:10
-
-
Save joshtronic/427d0591379dc4255673 to your computer and use it in GitHub Desktop.
self replicating node script
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
function replicate() { | |
tick = String.fromCharCode(39), | |
lines = [ | |
'function replicate() {', | |
' tick = String.fromCharCode(39),', | |
'', | |
' lines = [', | |
' ];', | |
'', | |
' lines.forEach(function(line, index) {', | |
' console.log(line);', | |
'', | |
' if (index == 3) {', | |
' lines.forEach(function(line) {', | |
' console.log(" " + tick + line + tick + ",");', | |
' });', | |
' }', | |
' });', | |
'}', | |
'', | |
'replicate();', | |
]; | |
lines.forEach(function(line, index) { | |
console.log(line); | |
if (index == 3) { | |
lines.forEach(function(line) { | |
console.log(" " + tick + line + tick + ","); | |
}); | |
} | |
}); | |
} | |
replicate(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment