Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const falseyValues = [false, '', 0, null, undefined]
- const truthyValues = [{}, [], 1, ' ', 'hello']
- const printItems = val => val ? console.log(`${val} is a truthy value`) : console.log(`${val} is a falsey value`)
- console.log('------')
- falseyValues.forEach(printItems)
- console.log('------')
- truthyValues.forEach(printItems)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement