You're viewing a comment by Isaac Z Schlueter and its responses.

May 01, 2012, 15:08

I consider putting the source code as a string in the quine also to be somewhat cheating ;P

Here's another that doesn't:

var s = arguments.callee.toString().split('\n');
s[0] = s[0].split('{ ')[1];
s = s.join('\n');

module.exports = function () {
if (module === require.main) module.exports();

And, yes, the simplest quite *function* is:

function quine () { return quine.toString() }

Comment Responses

May 01, 2012, 15:43

Nice one Isaac!

Here is another one by David Bjorklund:

function quine () { console.log('' + quine) }

Reply To This Comment

(why do I need your e-mail?)

(Your twitter name, if you have one. (I'm @pkrumins, btw.))

Type the first letter of your name: (just to make sure you're a human)

Please preview the comment before submitting to make sure it's OK.