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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T04:13:47+00:00 2026-06-11T04:13:47+00:00

A few weeks ago, I have read this thread Is < faster than <=?

  • 0

A few weeks ago, I have read this thread Is < faster than <=? about comparison operators in C. It was said that there is no difference in the performance between < and <= as they are interpreted as same/similar machine commands.

At the same time, in our company’s “best practices”, it was said that we should always use “===” to compare things instead of “==”. So, I started to wonder if this is always appropriate as I am used to using the “==” and “typeof … == ” and do not want to change my way of writing :-]

Note that this is in the context of JavaScript.

So, I have a little research and here Which equals operator (== vs ===) should be used in JavaScript comparisons? it is said that:

This is because the equality operator == does type coercion…meaning
that the interpreter implicitly tries to convert the values and then
does the comparing.

On the other hand, the identity operator === does not do type
coercion, and so thus it does not convert the values of the values
when comparing

And I started to wonder if this means that when I use the “===” operator, I will get good performance as no resources will be spent on converting the operands. And after all code is turned into machine commands, does this mean that just as there is no difference in C when you use < and <=, this is the same in JavaScript and other languages?

  • 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-11T04:13:48+00:00Added an answer on June 11, 2026 at 4:13 am

    for js, the === operator will return true if used on string types and the strings are exactly the same characters. For objects it compares the object references, not the contents.

    From the ECMA standard:

    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
      a. If x is NaN, return false.
      b. If y is NaN, return false.
      c. If x is the same Number value as y, return true.
      d. If x is +0 and y is -0, return true.
      e. If x is -0 and y is +0, return true.
      f. 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;
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

A few weeks ago I asked about Application Servers. It happens that my bosses
I asked about this on the jquery forum a few weeks ago without luck,
I have an old commit that I did a few weeks ago. I want
I have an animation that up till a few weeks ago worked in Google
i have a bit of code that i wrote a few weeks ago (the
I have started programming a few weeks ago in java/android. I want to write
A few weeks ago, I asked a question about how to generate hierarchical XML
I'm really frustrated with this one. A few weeks ago I got it working
i asked this a few weeks ago, but couldnt get any of the suggested
I have some bugs with Chrome. Since a few weeks ago the placeholders don't

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.