Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9127045
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T07:11:33+00:00 2026-06-17T07:11:33+00:00

Possible Duplicate: Why does !new Boolean(false) equals false in JavaScript? var b = new

  • 0

Possible Duplicate:
Why does !new Boolean(false) equals false in JavaScript?

var b = new Boolean(null);


alert(b instanceof Boolean);

 if(b) {
    alert('cv');
    alert(b.toString());
 }

Why if code block is executed? Is b supposed to be a boolean type and evaluated as false?

Please explain thanks

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T07:11:34+00:00Added an answer on June 17, 2026 at 7:11 am

    All objects are truthy, except null. Therefore, even if you write new Boolean(false) specifically, it will still be truthy.

    This is why you never write new Boolean. To cast to a boolean, just use !!

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Possible Duplicate: Why does (“foo” === new String(“foo”)) evaluate to false in JavaScript? Over
Possible Duplicate: C++'s “placement new” in the below code what does Line 3 represents,
Possible Duplicate: Why does Enumerable.All return true for an empty sequence? Code: var line
Possible Duplicate: In Javascript/jQuery what does (e) mean? I'm new to programming. What exactly
Possible Duplicate: Why does jQuery .after() not chain the new element? This reference code:
Possible Duplicate: does these code has memory leakage?? static private ArrayList seriesColors = new
Possible Duplicate: Why does getDay return incorrect values? (javascript) I have the following code
Possible Duplicate: What does new() mean? Like in title. I wonder what this syntax
Possible Duplicate: What does “(void) new” mean in C++? I'm not familiar with C++
Possible Duplicate: Does setting Java objects to null do anything anymore? I am using

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.