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

  • Home
  • SEARCH
  • 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 8379461
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T16:11:35+00:00 2026-06-09T16:11:35+00:00

Are booleans objects in JavaScript? Is it true that everything is an object in

  • 0

Are booleans objects in JavaScript? Is it true that “everything is an object” in JavaScript?

  • 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-09T16:11:37+00:00Added an answer on June 9, 2026 at 4:11 pm

    Primitives are not objects, everything else (any standard object) is an object. However, most primitives (all apart from undefined and null) have an object counterpart.

    So

    var a = false;
    

    is not an object, but

    var b = new Boolean(false);
    

    is.

    Since two objects are only equal if they refer to one and the same object, using the object version of primitives should better be avoided:

    a === false; // is true
    b === false // is false   <- this is a problem
    

    Or especially with boolean objects, using them with any boolean operators will create unexpected results. An object reference always evaluates to true, so the outcome of using b would be:

    // remember
    // a is the primitive value false
    // b is a boolean object with value false
    
    // NOT
    !a // true
    // but
    !b // false
    
    // AND
    a && true // false
    // but
    b && true // true
    

    There is no real advantage of using these object versions anyway, since JavaScript is autoboxing primitives when you try to call methods on them. That’s why calls like:

    var s = "HI THERE!".toLowerCase();
    s = s.substring(0,2);
    

    are possible.

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

Sidebar

Related Questions

Is it true that in JavaScript functions return objects other than Boolean and Numbers
w3schools says that exceptions can be strings, integers, booleans, or objects, but the example
I've come across two different ways to define/name objects and functions in JavaScript that
I'm building an hierarchy of objects that wrap primitive types, e.g integers, booleans, floats
UPDATED FROM ORIGINAL QUESTION I am trying to learn what a javascript object 'looks
In the Google JavaScript style guide, it says not to use wrapper objects for
MDN states: primitive, primitive value A data that is not an object and does
I have an array of associative arrays, i.e. objects, that hold the data of
There are regex matching methods on both RegExp objects and String objects in Javascript.
I have the following JavaScript code: alert(data.status); data is a JSON object, one of

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.