==
and !=
JS-0050 1/*! jQuery v3.6.0 | (c) OpenJS Foundation and other contributors | jquery.org/license */
2!(function (e, t) {
3 "use strict";
4 "object" == typeof module && "object" == typeof module.exports 5 ? (module.exports = e.document
6 ? t(e, !0)
7 : function (e) {
1/*! jQuery v3.6.0 | (c) OpenJS Foundation and other contributors | jquery.org/license */
2!(function (e, t) {
3 "use strict";
4 "object" == typeof module && "object" == typeof module.exports 5 ? (module.exports = e.document
6 ? t(e, !0)
7 : function (e) {
10 return t(e);
11 })
12 : t(e);
13})("undefined" != typeof window ? window : this, function (C, e) { 14 "use strict";
15 var t = [],
16 r = Object.getPrototypeOf,
32 y = {},
33 m = function (e) {
34 return (
35 "function" == typeof e && 36 "number" != typeof e.nodeType &&
37 "function" != typeof e.item
38 );
33 m = function (e) {
34 return (
35 "function" == typeof e &&
36 "number" != typeof e.nodeType && 37 "function" != typeof e.item
38 );
39 },
It is considered good practice to use the type-safe equality operators ===
and !==
instead of their regular counterparts ==
and !=
.
The strict equality operators (===
and !==
) use the strict equality comparison algorithm to compare two operands.
false
.true
only if they refer to the same object.null
or both operands are undefined
, return true
.NaN
, return false
.+0
and -0
are considered to be the same value.true
or both false
.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.
a == b
foo == true
bananas != 1
value == undefined
typeof foo == 'undefined'
'hello' != 'world'
0 == 0
true == true
foo == null
a === b
foo === true
bananas !== 1
value === undefined
typeof foo === 'undefined'
'hello' !== 'world'
0 === 0
true === true
foo === null