Variable Scope and Let Keyword

Run Settings
LanguageJavaScript
Language Version
Run Command
console.log("Hello World!"); /* the variable i seems to be a global varaible becoz of the eection style of the javascript code first it will create the variable i like var i; outside of the loop which makes it global also due to this scope of the i is not bound to for loop for(var i=0;i<10;i++) { console.log(i); } console.log(i); */ //therefore to tackle this issue let keyword is being introduced for(let i=0;i<10;i++) { console.log(i); } //console.log(i);
Editor Settings
Theme
Key bindings
Full width
Lines