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 7078627
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T06:34:16+00:00 2026-05-28T06:34:16+00:00

In Javascript i have read that we can define our own value for undefined

  • 0

In Javascript i have read that we can define our own value for undefined. Initially undefined == null is true.

  1. After we change the value of undefined will undefined == null still be true?
  2. By assigning our own value to undefined does it mean that we can assign real numbers to it?
  3. Why are there two absence of value thingies like null and undefined? Couldn’t we just do with one? Is there any difference between them?
  • 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-05-28T06:34:17+00:00Added an answer on May 28, 2026 at 6:34 am

    undefined is a variable on the global object which is window in browser environments. Its initial value is the primitive undefined.

    Being a property on the global object, historically you could have changed its value as,

    window.undefined = "42"; // or just undefined = "42"
    

    The meaning of life is now clearly defined. But since EcmaScript-5 is out, this has been disallowed, and even though it is still a property of the global object, it has been made non-writable now.

    The primitives null and undefined are not the same thing if no tampering has occurred.

    Null is a data type that has the sole value null. Undefined is another data type whose sole value is the primitive undefined. You can verify whether they represent the same object or not easily.

    null === undefined // false
    

    However,

    null == undefined // true
    

    is true, because they are both casted to the boolean value false before a comparison is made. The rules for converting both these values to boolean are clearly defined in section 9.2 of the spec.

    9.2 ToBoolean
    
    Argument Type | Result
    -------------------------------------------------------------------------
    Undefined     | false
    Null          | false
    Boolean       | The result equals the input argument (no conversion).
    Number        | ..
    String        | ..
    Object        | ..
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have read that Javascript's inheritance is prototypal.What does it mean?How can an object
Possible Duplicate: Can Read-Only Properties be Implemented in Pure JavaScript? I have an Object
Does jquery/javascript have any event model that you can attach to your objects? Basically
I have javascript string variable with var sttr=We prefer questions that can be answered
I have long read about Use cookie-free domains aka create a subdomain that can
I have a question on rollover effects using JavaScript. I have read that image
I usually do not have difficulty to read JavaScript code but for this one
Javascript I have code that will hide various sections in a MS CRM form
I have Javascript that opens another window and registers a click handler for all
I have JavaScript that is doing activity periodically. When the user is not looking

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.