created by Brian LeRoux & Andrew Lunny. sparodically uncurated by David Trejo.

2015 02 02 Boolean constructor

Why would you ever use this function, or constructor, or ...?

> Boolean(false)
false
> new Boolean(false)
{}
> {} == true
false
> Boolean({})
true
> Boolean(new Boolean(false))
true
> new Boolean(Boolean(false))
{}
> if (new Boolean(false)) console.log('Indeed')
Indeed

You couldn't make this stuff up.

@rtoal

Fork me on GitHub