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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T22:34:43+00:00 2026-05-25T22:34:43+00:00

JavaScript’s quirky weakly-typed == operator can easily be shown to be non-transitive as follows:

  • 0

JavaScript’s quirky weakly-typed == operator can easily be shown to be non-transitive as follows:

var a = "16";
var b = 16;
var c = "0x10";
alert(a == b && b == c && a != c); // alerts true

I wonder if there are any similar tricks one can play with roundoff error, Infinity, or NaN that could should show === to be non-transitive, or if it can be proved to indeed be transitive.

  • 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-25T22:34:44+00:00Added an answer on May 25, 2026 at 10:34 pm

    The === operator in Javascript seems to be as transitive as it can get.

    NaN is reliably different from NaN:

    >>> 0/0 === 0/0
    false
    >>> 0/0 !== 0/0
    true
    

    Infinity is reliably equal to Infinity:

    >>> 1/0 === 1/0
    true
    >>> 1/0 !== 1/0
    false
    

    Objects (hashes) are always different:

    >>> var a = {}, b = {};
    >>> a === b
    false
    >>> a !== b
    true
    

    And since the === operator does not perform any type coercion, no value conversion can occur, so the equality / inequality semantics of primitive types will remain consistent (i.e. won’t contradict one another), interpreter bugs notwithstanding.

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

Sidebar

Related Questions

JavaScript does funky automatic conversions with objects: var o = {toString: function() {return 40;
Javascript is pretty shaky for me, and I can't seem to find the answer
javascript with> var customer=document.getElementById('custList').value; and that works... Why does it work BUT... var customer=(form1.custList.value);
Javascript can manipulate the document the browser is displaying, so the following: <script> document.write(<table><tr><td>Hola</td><td>Adios</td></tr></table>);
JavaScript can interact very well with the server also. Using Ajax we can send
javascript code: $.getJSON(comprueba_login.php, {usuario:$(#usuario).val(), pwd:$(#contrasena).val()}, function(data){ alert(resultado: + data.resultado); }); php code: <?php include
Javascript SDK provides FB.login function to easily login other users. I just wonder whether
Javascript: var images = $('#slideshow').children(); var dot_holder = $('#slider_dots'); /* Create the dots*/ images.each(function(index,item){
JavaScript: var docHeadText = document.head.innerHTML; var patt =/\/*:.+?:*\//g; patt.compile(patt); docHeadText.match(patt); HTML: <head> <script type=text/javascript>
Javascript functions can be declared on a objects prototype like this: <object name>.prototype.<variable name>=function(){

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.