Last active
January 25, 2019 03:16
-
-
Save rameshvarun/4316afad76e6f0f86ca98da3fb8d7f9f to your computer and use it in GitHub Desktop.
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
let x = 0; | |
// WORKS | |
Math.random() | |
Date.now() | |
function test_false() { | |
if (false) { | |
return x++; | |
} | |
return 0; | |
} | |
function test_while() { | |
while(false) { | |
return x++; | |
} | |
return 0; | |
} | |
function pure_a() { return 4; } | |
function pure_b() { return pure_a(); } | |
// DOESN'T WORK | |
function test_date() { | |
if (Date.now() > Number.MAX_SAFE_INTEGER) { | |
return x++; | |
} | |
return 0; | |
} | |
function test_for() { | |
for (let i = 0; i < 10; ++i) { | |
if (i > 100) return x++; | |
} | |
return 0; | |
} | |
function a() { return x++; } | |
function b() { return a(); } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment