==
and !=
JS-0050208 value={
209 selectedMzn
210 ? mznOptions?.find(
211 (instance) => instance.value == selectedMzn.id212 )
213 : null
214 }
191 {(step === 1 &&
192 (mznInstances == undefined ? (
193 <PageLoader />
194 ) : mznInstances.length == 0 ? (195 <p>
196 You don't have any mzn instances yet, why don't your
197 create some?
189 <div className="container-fluid">
190 <div className="card shadow-sm">
191 {(step === 1 &&
192 (mznInstances == undefined ? (193 <PageLoader />
194 ) : mznInstances.length == 0 ? (
195 <p>
104 ) {
105 if (!dznInstances) return;
106 setSelectedDzn(
107 dznInstances?.find((instance) => instance.id == e?.value) as DznInstance108 );
109 }
110
92 ) {
93 if (!mznInstances) return;
94 setSelectedMzn(
95 mznInstances?.find((instance) => instance.id == e?.value) as MznInstance 96 );
97 }
98
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