Changed var to const (#22486)

Changed var to const to resemble the English version of the file
This commit is contained in:
Adrian Chira
2018-11-26 08:00:59 +02:00
committed by Kristofer Koishigawa
parent 804132b43b
commit 9a13212e2f

View File

@ -19,17 +19,17 @@ if (!variable) {
## 一般例子
```javascript
var string = ""; // <-- falsy
var filledString = "some string in here"; // <-- truthy
var zero = 0; // <-- falsy
var numberGreaterThanZero // <-- truthy
var emptyArray = []; // <-- truthy, we'll explore more about this next
var emptyObject = {}; // <-- truthy
const string = ""; // <-- falsy
const filledString = "some string in here"; // <-- truthy
const zero = 0; // <-- falsy
let numberGreaterThanZero; // <-- falsy
const emptyArray = []; // <-- truthy, we'll explore more about this next
const emptyObject = {}; // <-- truthy
```
## 有阵列的乐趣
@ -71,4 +71,4 @@ const match = { teamA: 0, teamB: 1 }
* [Falsy |词汇表| MDN](https://developer.mozilla.org/en-US/docs/Glossary/Falsy)
* [Truthy和Falsy当JavaScript中的所有不相等时](https://www.sitepoint.com/javascript-truthy-falsy/)
* [Truthy和Falsy当JavaScript中的所有不相等时](https://www.sitepoint.com/javascript-truthy-falsy/)