Problem Statement: Write a function that when executed return the definition of itself.
Quine144 views
function Quine(){
var cc = 34;
var str = "function Quine() { var cc=34; var str=xxxx; return str.replace('xxxx',String.fromCharCode(cc)+str+String.fromCharCode(cc)); }";
return str.replace('xxxx',String.fromCharCode(cc)+str+String.fromCharCode(cc));
}
One Comment
Beautiful!