Last active
July 21, 2018 05:15
-
-
Save snowman/e181284c8a0cafb4308a1454707f8115 to your computer and use it in GitHub Desktop.
Javascript SetTimeout asynchronomous Test...
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
var changed = false; | |
setTimeout(function () { | |
console.log("I'm hacking in setTimeout~~~"); | |
changed = true; | |
}) | |
while (true) { | |
if (changed) { | |
console.log("The system has been hacked by outer program. Exiting..."); | |
break; | |
} | |
} | |
setTimeout(function () { | |
console.log(`The value of $changed: ${changed}`); | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment