Last active
March 2, 2020 05:25
-
-
Save YonatanKra/7799aabfb41f6cd8416c9b450c8dd83c to your computer and use it in GitHub Desktop.
Bad retry
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
function retry() { | |
try { | |
console.log(window.toBe.orNotToBe); | |
} catch(e) { | |
retry(); | |
} | |
} | |
retry(); | |
// simulate a fetch action from the server | |
setTimeout(() => { | |
window.toBe = {orNotToBe: "That is the question!"} | |
}, 1000); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment