A falsy value is something which evaluates to FALSE, for instance when checking a variable. There are only six falsy values in JavaScript: `undefined`, `null`, `NaN`, `0`, `""` or `''` (empty string), and `false` of course.
if ([] == false) // <--truthy,willruncodeinif-block
if ([]) // <--truthy,willalsoruncodeinif-block
if ([] == true) // <--falsy,willNOTruncodeinif-block
if (![]) // <--falsy,willalsoNOTruncodeinif-block
```
## Caveat
Be aware of the data type when evaluating a value in a Boolean context. If the data type of the value is meant to be a _number_, the truthy/falsy evalution can result in an unexpected outcome:
```javascript
const match = { teamA: 0, teamB: 1 }
if (match.teamA)
// The following won't run due to the falsy evaluation
console.log('Team A: ' + match.teamA);
}
```
An alternative to the use case above is to evaluate the value using `typeof`:
```javascript
const match = { teamA: 0, teamB: 1 }
if (typeof match.teamA === 'number')
console.log('Team A: ' + match.teamA);
}
```
## More Information
-<a>**truthy**</a> | <ahref='http://james.padolsey.com/javascript/truthy-falsey/'target='_blank'rel='nofollow'>Blog Post - Truthy & Falsey</a>