Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

falsy values javascript

//check falsy value using Boolean()
//if it falsy it return false

let falsyValue = [0, "", NaN, undefined, false, null, -0, 022, 100, {}, []]

falsyValue.forEach(ele => {
    console.log(Boolean(ele))
})
Source by developer.mozilla.org #
 
PREVIOUS NEXT
Tagged: #falsy #values #javascript
ADD COMMENT
Topic
Name
3+5 =