==
and !=
JS-0050 9 });
10 // Attempt to get token
11 const dbtok = redis.get(`${process.env.UPSTASH_REDIS_BASEKEY}:users:accounts:${req.query.authToken}`);
12 if (!dbtok || JSON.stringify(dbtok) == "{}") {13 //res.redirect(302, "/sign-up?error=BadTOK");
14 //return;
15 }
14 res.redirect(302, "/sign-in?error=Internal");
15 return;
16 }
17 var valid = (dbq.email == body.email) && (dbq.password == body.password);18 if (valid) {
19 var token = uuidv4();
20 redis.set(`${process.env.UPSTASH_REDIS_BASEKEY}:auth:sessions:${token}`, `${process.env.UPSTASH_REDIS_BASEKEY}:users:users:${dbq.email}`, {
14 res.redirect(302, "/sign-in?error=Internal");
15 return;
16 }
17 var valid = (dbq.email == body.email) && (dbq.password == body.password);18 if (valid) {
19 var token = uuidv4();
20 redis.set(`${process.env.UPSTASH_REDIS_BASEKEY}:auth:sessions:${token}`, `${process.env.UPSTASH_REDIS_BASEKEY}:users:users:${dbq.email}`, {
15 const [count, setCount] = useState(0);
16 const nextCount = () => {
17 let r = -1;
18 while (r < 0 || r == count) {19 r = Math.floor(Math.random() * items.length);
20 }
21 return r;//(count + 1) % (items.length - 1);//(count < items.length - 1) ? count + 1 : 0;
17 JSON.parse(
18 localStorage.getItem("darkMode")
19 .toLowerCase()
20 ) && dark == false21 ) {
22 toggle();
23 }
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