Javascript Function Global Object

Description

Javascript Function Global Object

a = "aaa";//from   w  w w .  java 2  s. c  o m


// Getting the global object
function getGlobal() {
    return (function(){
        return this;
    }).call(null);
}
let globalObj = getGlobal();
console.log(globalObj.a);



PreviousNext

Related