Changed var to const (#22486)
Changed var to const to resemble the English version of the file
This commit is contained in:
committed by
Kristofer Koishigawa
parent
804132b43b
commit
9a13212e2f
@ -19,17 +19,17 @@ if (!variable) {
|
|||||||
## 一般例子
|
## 一般例子
|
||||||
|
|
||||||
```javascript
|
```javascript
|
||||||
var string = ""; // <-- falsy
|
const string = ""; // <-- falsy
|
||||||
|
|
||||||
var filledString = "some string in here"; // <-- truthy
|
const filledString = "some string in here"; // <-- truthy
|
||||||
|
|
||||||
var zero = 0; // <-- falsy
|
const zero = 0; // <-- falsy
|
||||||
|
|
||||||
var numberGreaterThanZero // <-- truthy
|
let numberGreaterThanZero; // <-- falsy
|
||||||
|
|
||||||
var emptyArray = []; // <-- truthy, we'll explore more about this next
|
const emptyArray = []; // <-- truthy, we'll explore more about this next
|
||||||
|
|
||||||
var emptyObject = {}; // <-- truthy
|
const emptyObject = {}; // <-- truthy
|
||||||
```
|
```
|
||||||
|
|
||||||
## 有阵列的乐趣
|
## 有阵列的乐趣
|
||||||
|
Reference in New Issue
Block a user