I know that
if (val) { }
will evaluate to true as long as value is not:
- null
- undefined
- NaN
- empty
- string ("")
- 0
- false
whats different to
if (!!val) { }
Find centralized, trusted content and collaborate around the technologies you use most.
Learn more about CollectivesStack Internal
Knowledge at work
Bring the best of human thought and AI automation together at your work.
Explore Stack InternalI know that
if (val) { }
will evaluate to true as long as value is not:
whats different to
if (!!val) { }