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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T17:58:32+00:00 2026-05-26T17:58:32+00:00

In JavaScript spec: http://www.ecma-international.org/publications/standards/Ecma-262.htm 11.9.6 The Strict Equality Comparison Algorithm The comparison x ===

  • 0

In JavaScript spec: http://www.ecma-international.org/publications/standards/Ecma-262.htm

11.9.6 The Strict Equality Comparison Algorithm

The comparison x === y, where x and y are values, produces true or
false. Such a comparison is performed as follows:

  1. If Type(x) is different from Type(y), return false.
  2. If Type(x) is Undefined, return true.
  3. If Type(x) is Null, return true.
  4. If Type(x) is Number, then
    1. If x is NaN, return false.
    2. If y is NaN, return false.
    3. If x is the same Number value as y, return true.
    4. If x is +0 and y is -0, return true.
    5. If x is -0 and y is +0, return true.
    6. Return false.
  5. If Type(x) is String, then return true if x and y are exactly the same sequence of characters (same length and same characters in
    corresponding positions); otherwise, return false.
  6. If Type(x) is Boolean, return true if x and y are both true or both false; otherwise, return false.
  7. Return true if x and y refer to the same object. Otherwise, return false. NOTE This algorithm differs from the SameValue Algorithm (9.12)
    in its treatment of signed zeroes and NaNs

What does the bolded section mean? How do you write out some JavaScript to confirm it?
I tried alert(typeof(undefined) === 'x'); but it gives me false.

  • 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-26T17:58:33+00:00Added an answer on May 26, 2026 at 5:58 pm

    Before that it says:

    where x and y are value

    So first, give x and y values.

    Then forget “blah”, 1 is important. x and y have to be the same type to get past step 1.

    Step 2 is “If Type(x) is Undefined, return true.”.

    There is only one value that gives the undefined type, undefined. Thus, the only way to test step 2 (short of assigning undefined to variables):

    alert(undefined === undefined)
    

    … will give true.

    Step 3 works in exactly the same way. The only null value is null.

    alert(null === null)
    

    A manual implementation the algorithm would start like this:

    function equalsequalsequals(x, y)
    if (typeof x != typeof y) {
        return false;
    } else if (typeof x == "undefined") {
        return true;
    } // …
    

    The typeof operator can’t tell us if something is null or not, so you can’t completely implement the algorithm without using ===. Since we have ===, however, we don’t need to.

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

Sidebar

Related Questions

In chapter 7.7 (Punctuators) of the ECMAScript spec ( http://www.ecma-international.org/publications/files/ECMA-ST/ECMA-262.pdf ) the grid of
The The OpenGL ® Shading Language Spec version 1.20 http://www.opengl.org/registry/doc/GLSLangSpec.Full.1.20.8.pdf shows the following: struct
Question: does operand order make any difference when evaluating equality or identity in JavaScript?
Let's say, a javascript tag's src attribute points to a redirect: <script src=http://foo.com/foo.js></script> where
In the current HTTP spec, the URL fragment (the part of the URL including
There is an example HMAC-SHA1 here that works in javascript http://jssha.sourceforge.net/ Text to encrypt
I have a simple JavaScript file, color.js , and a matching spec file, colorSpec.js
So I ran across this recently: http://www.nicalis.com/ And I was curious: Is there a
Jasmine Test: describe 'Toolbar', -> beforeEach -> jasmine.getFixtures().fixturesPath = ../spec/javascript/fixtures loadFixtures(canvas_fixture.html) describe 'Rectangle Button
Passing this code through jsHint: var A = function (spec) { use strict; var

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.