var name = 'John'; console.log(this.name, document.name, window.name, name); const meme = "Bruce"; console.log(this.meme, document.meme, window.meme, meme);
Output:
John undefined John John undefined undefined undefined "Bruce"
Is a global scope defined for var and const? I thought the only difference would be const immutable.
source share