Here the difference between let and var

var a = 2;

(function IIFE(global){
    var a =3
    console.log(a)//3
    console.log(global.a)//2
})(window);
console.log(a);//2

let a = 2;

(function IIFE(global){
    var a =3
    console.log(a)//3
    console.log(global.a)//undefine   undefined
})(window);
console.log(a);//2
Mar.09,2021

let const does not bind variables to window objects even if they are defined in the global environment.
you can find a basic book


properties of top-level objects

.
MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b38bc4-2c12e.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b38bc4-2c12e.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?