Created
December 21, 2014 14:31
-
-
Save ItangSanjana/8afda0c6d7de39cbf1a0 to your computer and use it in GitHub Desktop.
The Infinite Loop of "I Love U" In JavaScript
This file contains 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
//The Conditionless For | |
for (;;) { | |
console.log("\u0049 \u2665 \u0055"); | |
} | |
//The Unchanging Condition | |
while (1 < 2) { | |
console.log("\u0049 \u2665 \u0055"); | |
} | |
//Infinite Recursion | |
function iLoveYou() { | |
console.log("\u0049 \u2665 \u0055"); | |
iLoveYou(); | |
} | |
//The For Loop Reset | |
for (var i = 0; i < 2; i++) { | |
console.log("\u0049 \u2665 \u0055"); | |
i = 0; | |
} | |
//60 times Per Second | |
function iLoveYou() { | |
console.log("\u0049 \u2665 \u0055"); | |
var repeat = window.requestAnimationFrame(iLoveYou); | |
} | |
//Global Condition, Local Change (a variant on The Unchanging Condition) | |
var i = 0; | |
function increment() { | |
var i; // creates local var | |
i++; | |
} | |
while (i < 5) { | |
console.log("\u0049 \u2665 \u0055"); | |
increment(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment