Skip to content

Instantly share code, notes, and snippets.

@joews
Created January 26, 2015 11:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save joews/dd707ee71c322081ba42 to your computer and use it in GitHub Desktop.
Save joews/dd707ee71c322081ba42 to your computer and use it in GitHub Desktop.
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>JS Bin</title>
</head>
<body>
<script id="jsbin-javascript">
//
// My first attempt at a JS Quine (a program that prints itself)
//
// (T = function () { document.write('(T = ' + this.toString() + ').call(T)') }).call(T)
/* output:
(T = function () { document.write('(T = ' + this.toString() + ').call(T)') }).call(T)
*/
// shorter
// (space after function is always present in output)
(S=function (){document.write('(S='+S+')()')})()
/*
(S=function (){document.write('(S='+S+')()')})()
*/
</script>
<script id="jsbin-source-javascript" type="text/javascript">//
// My first attempt at a JS Quine (a program that prints itself)
//
// (T = function () { document.write('(T = ' + this.toString() + ').call(T)') }).call(T)
/* output:
(T = function () { document.write('(T = ' + this.toString() + ').call(T)') }).call(T)
*/
// shorter
// (space after function is always present in output)
(S=function (){document.write('(S='+S+')()')})()
/*
(S=function (){document.write('(S='+S+')()')})()
*/</script></body>
</html>
//
// My first attempt at a JS Quine (a program that prints itself)
//
// (T = function () { document.write('(T = ' + this.toString() + ').call(T)') }).call(T)
/* output:
(T = function () { document.write('(T = ' + this.toString() + ').call(T)') }).call(T)
*/
// shorter
// (space after function is always present in output)
(S=function (){document.write('(S='+S+')()')})()
/*
(S=function (){document.write('(S='+S+')()')})()
*/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment