Change var to const (#20331)
This commit is contained in:
@ -19,17 +19,17 @@ if (!variable) {
|
|||||||
## General Examples
|
## General Examples
|
||||||
|
|
||||||
```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; // <-- falsy
|
const 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
|
||||||
```
|
```
|
||||||
|
|
||||||
## Fun With Arrays
|
## Fun With Arrays
|
||||||
|
Reference in New Issue
Block a user