Consider following code snippet:
var bool = new Boolean(false);
if (bool) {
} else {
What will be printed to the console?
new Boolean(false) returns an object which is not null. Non-null objects are always truthy. Example:

var bool = new Boolean(false);
typeof(bool); // object

@Vadim_Klimets ;)

2017 Jun 6, 4:37:37 PM

Tricky question!

2017 May 29, 5:59:28 PM

Follow CodeGalaxy

Mobile Beta

Get it on Google Play
Send Feedback