| CARVIEW |
Select Language
HTTP/2 200
x-guploader-uploadid: AHVrFxP5qN-fiFIQ08GtlXZIgTx7MfkmmMXVu89HMCfQPKsmXuKFiNjKv11ItWv2WV7NyJhIlgq4xuo
cache-control: public, max-age=3600
x-goog-hash: crc32c=aUQ0nQ==, md5=GC2YuRqdLIhC62sKuCffkg==
x-cloud-trace-context: 042affcc9362c914588397cb4322e7e4
x-frame-options: DENY
via: 1.1 google, 1.1 varnish, 1.1 varnish, 1.1 varnish, 1.1 varnish
server: Google Frontend
expires: Sun, 28 Dec 2025 05:37:50 GMT
last-modified: Sun, 28 Dec 2025 01:10:36 GMT
x-goog-stored-content-length: 190683
x-goog-metageneration: 1
strict-transport-security: max-age=63072000
x-goog-meta-goog-reserved-file-mtime: 1766883133
x-content-type-options: nosniff
x-goog-storage-class: STANDARD
x-goog-stored-content-encoding: identity
origin-trial: AxVILwizhbMjxFeHOn1P3R8niO1RJY/smaK4B4d1rLzc1gTaxtXMSaTi+FoigYgCw40uFRDwFcEAeqDR+vVLOW4AAABfeyJvcmlnaW4iOiJodHRwczovL2RldmVsb3Blci5tb3ppbGxhLm9yZyIsImZlYXR1cmUiOiJQcml2YXRlQXR0cmlidXRpb25WMiIsImV4cGlyeSI6MTc0MjA3OTYwMH0=
content-type: text/html
referrer-policy: strict-origin-when-cross-origin
content-security-policy: default-src 'self'; script-src 'report-sample' 'self' 'wasm-unsafe-eval' https://www.google-analytics.com/analytics.js https://*.googletagmanager.com assets.codepen.io production-assets.codepen.io https://js.stripe.com 'sha256-XNBp89FG76amD8BqrJzyflxOF9PaWPqPqvJfKZPCv7M=' 'sha256-YCNoU9DNiinACbd8n6UPyB/8vj0kXvhkOni9/06SuYw=' 'sha256-PZjP7OR6mBEtnvXIZfCZ5PuOlxoDF1LDZL8aj8c42rw='; script-src-elem 'report-sample' 'self' 'wasm-unsafe-eval' https://www.google-analytics.com/analytics.js https://*.googletagmanager.com assets.codepen.io production-assets.codepen.io https://js.stripe.com 'sha256-XNBp89FG76amD8BqrJzyflxOF9PaWPqPqvJfKZPCv7M=' 'sha256-YCNoU9DNiinACbd8n6UPyB/8vj0kXvhkOni9/06SuYw=' 'sha256-PZjP7OR6mBEtnvXIZfCZ5PuOlxoDF1LDZL8aj8c42rw='; style-src 'report-sample' 'self' 'unsafe-inline'; object-src 'none'; base-uri 'self'; connect-src 'self' developer.allizom.org bcd.developer.allizom.org bcd.developer.mozilla.org updates.developer.allizom.org updates.developer.mozilla.org https://*.google-analytics.com https://*.analytics.google.com https://*.googletagmanager.com https://incoming.telemetry.mozilla.org https://observatory-api.mdn.allizom.net https://observatory-api.mdn.mozilla.net https://api.github.com/search/issues stats.g.doubleclick.net https://api.stripe.com; font-src 'self'; frame-src 'self' mdn.github.io *.mdnplay.dev *.mdnyalp.dev *.play.test.mdn.allizom.net https://v2.scrimba.com https://scrimba.com jsfiddle.net www.youtube-nocookie.com codepen.io survey.alchemer.com https://js.stripe.com; img-src 'self' data: *.githubusercontent.com *.googleusercontent.com *.gravatar.com mozillausercontent.com firefoxusercontent.com profile.stage.mozaws.net profile.accounts.firefox.com developer.mozilla.org mdn.dev wikipedia.org upload.wikimedia.org https://mdn.github.io/shared-assets/ https://mdn.dev/ https://*.google-analytics.com https://*.googletagmanager.com www.gstatic.com; manifest-src 'self'; media-src 'self' archive.org videos.cdn.mozilla.net https://mdn.github.io/shared-assets/; child-src 'self'; worker-src 'self';
etag: "182d98b91a9d2c8842eb6b0ab827df92"
x-goog-generation: 1766884236250498
content-encoding: gzip
accept-ranges: bytes
age: 0
date: Sun, 28 Dec 2025 07:14:44 GMT
x-served-by: cache-bfi-kbfi7400091-BFI, cache-bfi-kbfi7400064-BFI, cache-sin-wsss1830089-SIN, cache-bom-vanm7210098-BOM
x-cache: MISS, MISS, HIT, MISS
x-cache-hits: 0, 0, 0, 0
x-timer: S1766906085.540768,VS0,VE401
vary: Accept-Encoding
content-length: 26855
Strict equality (===) - JavaScript | MDN
Toggle sidebar
>
Strict equality (===)
Baseline
Widely available
This feature is well established and works across many devices and browser versions. It’s been available across browsers since July 2015.
The strict equality (===) operator checks whether its two operands are
equal, returning a Boolean result. Unlike the equality operator,
the strict equality operator always considers operands of different types to be
different.
Try it
console.log(1 === 1);
// Expected output: true
console.log("hello" === "hello");
// Expected output: true
console.log("1" === 1);
// Expected output: false
console.log(0 === false);
// Expected output: false
Syntax
js
x === y
Description
The strict equality operators (=== and !==) provide the IsStrictlyEqual semantic.
- If the operands are of different types, return
false. - If both operands are objects, return
trueonly if they refer to the same object. - If both operands are
nullor both operands areundefined, returntrue. - If either operand is
NaN, returnfalse. - Otherwise, compare the two operand's values:
- Numbers must have the same numeric values.
+0and-0are considered to be the same value. - Strings must have the same characters in the same order.
- Booleans must be both
trueor bothfalse.
- Numbers must have the same numeric values.
The most notable difference between this operator and the equality
(==) operator is that if the operands are of different types, the
== operator attempts to convert them to the same type before comparing.
Examples
>Comparing operands of the same type
js
"hello" === "hello"; // true
"hello" === "hola"; // false
3 === 3; // true
3 === 4; // false
true === true; // true
true === false; // false
null === null; // true
Comparing operands of different types
js
"3" === 3; // false
true === 1; // false
null === undefined; // false
3 === new Number(3); // false
Comparing objects
js
const object1 = {
key: "value",
};
const object2 = {
key: "value",
};
console.log(object1 === object2); // false
console.log(object1 === object1); // true
Specifications
| Specification |
|---|
| ECMAScript® 2026 Language Specification> # sec-equality-operators> |