📜  javascript 全局对象 - Javascript 代码示例

📅  最后修改于: 2022-03-11 15:01:22.855000             🧑  作者: Mango

代码示例1
//Access Global variable
var foo = "foobar";
foo === window.foo; // Returns: true


//Accessing Global Functions
function greeting() {
   console.log("Hi!");
}

window.greeting();