==
and !=
JS-005039 let magicNumber = 3000;
40 let interval = setInterval(() => {
41 setTime((new Date()).getTime());
42 if (((Math.floor(time / magicNumber) * magicNumber) % magicNumber) == 0) {43 forward();
44 } else {
45 console.log(time);
10 let l = [];
11 imageSrcs.forEach((imageSrc, i) => {
12 l.push(
13 <img className={`flex-1 rounded w-auto h-auto ml-auto mr-auto max-w-sm md:max-w-md lg:max-w-lg xl:max-w-xl 2xl:max-w-2xl ${(index == i) ? styles.imageCarouselActiveImage : styles.imageCarouselInactiveImage}`} src={imageSrc} key={i}/>14 )
15 });
16 setImages(l);
15 });
16 setImages(l);
17 }
18 if (images.length == 0) {19 loadImages();
20 }
21 const forward = () => {
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}`, {
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