Consider following code snippet:
var bool = new Boolean(false);
if (bool) {
   console.log('Hello');
} else {
   console.log('Error');
}
What will be printed to the console?
Explanation
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
Cosmo
Sign Up Now
or Subscribe for future quizzes