A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://www.geeksforgeeks.org/javascript/strict-equality-comparison-operator-in-javascript/ below:

Strict Equality(===) Comparison Operator in JavaScript

Strict Equality(===) Comparison Operator in JavaScript

Last Updated : 23 Jul, 2025

JavaScript Strict Equality Operator is used to compare two operands and return true if both the value and type of operands are the same. Since type conversion is not done, so even if the value stored in operands is the same but their type is different the operation will return false. 

Syntax:

a===b

Example 1: In this example, we will compare the value of the same data types.

JavaScript
let a = 2, b=2, c=3;
let d = {name:"Ram"};
let e = {name:"Ram"};
let f = e;

console.log(a===b);
console.log(a===c);
console.log(d===e);
console.log(f===e);

Output: Just like other comparisons when two objects are compared their reference is checked and true is only returned if the reference is the same.

true
false
false
true

Example 2: In this example, we will use the strict equality operator on different data types.

JavaScript
let a = 2;
let b= "2";
let c = true;
let d = null;
let e = undefined;

console.log(a===b);
console.log(a===c);
console.log(d===e);

Output: Even though some values are the same but still false is returned as the data type is different.

false
false
false

Supported Browsers:

We have a complete list of JavaScript Comparison Operators, to check those please go through, the JavaScript Comparison Operator article



RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4