Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
yihan12 authored Dec 13, 2023
1 parent 3db6249 commit 448951b
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions javascript/variables/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -145,4 +145,15 @@ function myFunction() {
}
```

### 全局作用域

全局声明的变量(在任何函数之外)具有全局范围。
可以从JavaScript程序中的任何位置访问全局变量。
使用var、let和const声明的变量在块之外声明时非常相似。
它们都有全局范围:
```javascript
var x = 2; // Global scope
let y = 2; // Global scope
const z = 2; // Global scope
```

0 comments on commit 448951b

Please sign in to comment.