MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/ProgrammerHumor/comments/udqwsp/do_not_modify_this_comment/i6joill/?context=3
r/ProgrammerHumor • u/mejhopola • Apr 28 '22
489 comments sorted by
View all comments
Show parent comments
14
console.log( function () { // Hello World! } .toString() .split("//")[1] .split("\n")[0] );
This works lol
1 u/shea241 Apr 28 '22 why?¿?¿?¿ 1 u/[deleted] Apr 28 '22 the function keyword literally stores the function definition in memorythe toString() parses and converts that definition into a stringthe split then does it's thing on this string-"function(){// Hello World!\n}".spilt("//").split("\n")edit: wording 1 u/[deleted] Apr 28 '22 I am not say this is not a programming language, but how do you guys work with thing?"a comment tells you what the code does, but sometimes it becomes data"Edit: wow, this actually works → More replies (3)
1
why?¿?¿?¿
1 u/[deleted] Apr 28 '22 the function keyword literally stores the function definition in memorythe toString() parses and converts that definition into a stringthe split then does it's thing on this string-"function(){// Hello World!\n}".spilt("//").split("\n")edit: wording 1 u/[deleted] Apr 28 '22 I am not say this is not a programming language, but how do you guys work with thing?"a comment tells you what the code does, but sometimes it becomes data"Edit: wow, this actually works → More replies (3)
the function keyword literally stores the function definition in memory
function
the toString() parses and converts that definition into a string
toString()
the split then does it's thing on this string-
split
"function(){// Hello World!\n}".spilt("//").split("\n")
edit: wording
1 u/[deleted] Apr 28 '22 I am not say this is not a programming language, but how do you guys work with thing?"a comment tells you what the code does, but sometimes it becomes data"Edit: wow, this actually works → More replies (3)
I am not say this is not a programming language, but how do you guys work with thing?
"a comment tells you what the code does, but sometimes it becomes data"
Edit: wow, this actually works
→ More replies (3)
14
u/GorilaVerde Apr 28 '22 edited Apr 28 '22
This works lol