Difference Between “==” And “===”

Home Forums Java Script Difference Between “==” And “===”

This topic contains 1 reply, has 2 voices, and was last updated by  Sushmita Ghosh 3 years ago.

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #1395

    Divya
    Participant

    What Is The Difference Between “==” And “===”?

    #1396

    Sushmita Ghosh
    Keymaster

    These are the operators provided by JavaScript – strict equality and Type converting equality.

    Strict equality (===) returns true if the values which it is going to compare have the same data type. Taking an example, “2” will not be equal to 2  i.e. (“2″===2) will return false.

    Secondly, Type converting equality (==), automatically converts the variable to value irrespective of the data type. Taking an example, here “2” will be equal to 2  i.e. (“2″===2) will return true.

    Summarizing it, double equal (==) is an autotype converting equality operator while three equals (===) is a strict equality operator, i.e. it will not convert values automatically.

Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.

Pasham Technology © 2018 Pasham Technologies