mirror of
https://github.com/airbnb/javascript.git
synced 2026-01-14 04:48:12 -05:00
Clearly show that [] is truthy
This commit is contained in:
@@ -1250,9 +1250,9 @@ Other Style Guides
|
||||
+ **Strings** evaluate to **false** if an empty string `''`, otherwise **true**
|
||||
|
||||
```javascript
|
||||
if ([0]) {
|
||||
if ([0] && []) {
|
||||
// true
|
||||
// An array is an object, objects evaluate to true
|
||||
// An array (even an empty one) is an object, objects will evaluate to true
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
Reference in New Issue
Block a user