In the chrome console, when I declare variables with let
or const
these DO NOT become the property of window
object. However, the variable declared with var
DO becomes the direct property of the window object in the chrome console. For e.g:
let sayHi = 'Hi'
const greet = 'Good Morning'
var sayHola = 'Hola Hola'
window.hasOwnProperty('sayHi') //false
window.hasOwnProperty('greet') //false
window.hasOwnProperty('sayHola') //true
Then what are the actual scopes/object of a variable declared with let
or const
in the chrome console?