What are Equality operators? Does ‘==’ and ‘===’ mean same and serve the same purpose? Do we really need two operators for checking the equality of a statement?

Equality in javascript

Before getting into equality operators its important that you understand data types in javascript. Javascript is a loosely typed and dynamic language. The variable is dynamically associated with a type based on the value. A given variable can be assigned and re-assigned different types.

There are Primitive and Complex data types.

Primitive Data types: N_umber, String, Boolean, undefined, null, BigInt, and Symbol._

Complex Data types:_ object and function_

**Type coercion(typecasting) **is the process of converting a value from one type to another. Type coercion can be implicit or explicit.

Implicit type coercion is when a value is converted between different types automatically.

For example: 2/’5’ // results in 0.4

_Explicit type coercion _is when the developer explicitly converts a value from one type to another.

For example: String(765) // results in “765”

Equality operators are part of javascript comparison operators they evaluate the statement to either true or false.


JavaScript has 2 operators for checking equality ‘==’ and ‘===’. We are here to understand what is the difference between these two operators??

#javascript #data-type #equality #programming

Equality Operator in Javascript
1.10 GEEK