Skip to content

Instantly share code, notes, and snippets.

@mihailik
Last active August 29, 2015 14:16
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 mihailik/da0b28725f9e8c607f3d to your computer and use it in GitHub Desktop.
Save mihailik/da0b28725f9e8c607f3d to your computer and use it in GitHub Desktop.
Recursive let
<html>
<pre id=myscriptout>
</pre>
<div id=myout>
</div>
<script id=myfunc type=text>
function ro() {
"use strict";
let x = Date.now() < 0 ? x : 10;
return x;
}
</script>
<script id=myscript type="application/javascript;version=1.7">
try {
eval(document.getElementById('myfunc').textContent);
document.getElementById('myout').textContent = ro();
document.getElementById('myscriptout').textContent = ro;
}
catch (err) {
document.getElementById('myout').textContent = err + ' ' + err.stack;
}
</script>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment