其他分享
首页 > 其他分享> > 记录-Execution Context(Global)

记录-Execution Context(Global)

作者:互联网

Execution Context--执行上下文

 

The global execution context creates two things for you.

It create a Global Object and a special variable for you , called "this".

Remember an object is just a collection of name value pairs.

test.html

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>js</title>
    
</head>
<body>
    
</body>
<script src="./test.js"></script>
</html>

test.js

var a = "yibo"; // 全局变量

let b = "baby";  // 非全局变量

function f1 () {
    console.log("test")
}

 

 

 

 

 

 

 

标签:全局变量,Global,js,Context,test,Execution
来源: https://www.cnblogs.com/huguo/p/16339924.html