const
declarations for variables that are never reassigned JS-024255 </div>
56 )
57 }
58 let l = [];59 for (let i = 0; i < jdata.enemies.length; i++) {
60 l.push((
61 <Link href={`/game-info/enemy-stats/${jdata.enemies[i].toLowerCase()}`} className="">
39 pass: process.env.EMAIL_SERVER_PASSWORD,
40 },
41 });
42 let info = await transporter.sendMail({43 from: `"The-Caverns" <${process.env.EMAIL_FROM}>`,
44 to: body.email,
45 subject: "Sign up for The Caverns",
30 ex: 86400
31 });
32 // Send email
33 let transporter = nodemailer.createTransport({34 host: "mail.ee",
35 port: 465,
36 secure: true,
3import { Redis } from "@upstash/redis";
4
5export default async function handler(req, res) {
6 let c = getCookie("ahc", { req, res }); 7 if (!c) {
8 res.redirect(302, "/?error=SoF");
9 return;
21 return r;//(count + 1) % (items.length - 1);//(count < items.length - 1) ? count + 1 : 0;
22 }
23 const uef = () => {
24 let interval = setInterval(() => {25 //setTv(items[count]);
26 setTv(ntv);
27 setCount(nextCount);
Variables that are never re-assigned a new value after their initial declaration should be declared with the const
keyword.
This prevents the programmer from erroneously re-assigning to a read-only variable, and informs those reading the code that a variable is a constant value.
let pi = Math.PI
for (let x of xs) {
use(x);
}
let { a, b } = object;
use(a, b);
const pi = Math.PI
for (const x of xs) {
use(x);
}
const { a, b } = object;
use(a, b);