Created
September 12, 2020 10:15
-
-
Save obetame/ea8a9e21c6ffab2979be93e6bd9a4b1f to your computer and use it in GitHub Desktop.
This file contains hidden or 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
const age = 2; | |
function example(str) { | |
eval(str); | |
console.log(age); | |
} | |
example('const age=3;'); //output:2 | |
example("'use strict'; var age=6;"); //output:2 | |
example('var age=4;'); // output: 4 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment