==
and !=
JS-0050 98 try {
99 await Model.findOneAndUpdate({_id: data[i]._id}, {used: true}, {new: true})
100 let response = await web3.eth.sendSignedTransaction('0x' + signedTx.serialize().toString('hex'))
101 if(response.transactionHash == null) {102 console.error('trascation not minded')
103 }
104 response.hash = response.transactionHash
238 console.log('log->signedTx', signedTx)
239 try {
240 let response = await web3.eth.sendSignedTransaction('0x' + signedTx.serialize().toString('hex'))
241 if(response.transactionHash == null) {242 res.status(500).json({ message: `Transaction not mined` })
243 }
244 response.hash = response.transactionHash
182
183 try {
184 let response = await web3.eth.sendSignedTransaction('0x' + signedTx.serialize().toString('hex'))
185 if(response.transactionHash == null) {186 res.status(500).json({ message: `Transaction not mined` })
187 }
188 response.hash = response.transactionHash
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