const
declarations for variables that are never reassigned JS-024237 let days = Math.floor(client.uptime / 86400000)
38 let hours = Math.floor(client.uptime / 3600000) % 24
39 let minutes = Math.floor(client.uptime / 60000) % 60
40 let seconds = Math.floor(client.uptime / 1000) % 6041
42 // Latency Check
43 let webLatency = new Date() - interaction.createdAt
36 // Function Uptime
37 let days = Math.floor(client.uptime / 86400000)
38 let hours = Math.floor(client.uptime / 3600000) % 24
39 let minutes = Math.floor(client.uptime / 60000) % 6040 let seconds = Math.floor(client.uptime / 1000) % 60
41
42 // Latency Check
35 try {
36 // Function Uptime
37 let days = Math.floor(client.uptime / 86400000)
38 let hours = Math.floor(client.uptime / 3600000) % 2439 let minutes = Math.floor(client.uptime / 60000) % 60
40 let seconds = Math.floor(client.uptime / 1000) % 60
41
34 async execute(client, interaction) {
35 try {
36 // Function Uptime
37 let days = Math.floor(client.uptime / 86400000)38 let hours = Math.floor(client.uptime / 3600000) % 24
39 let minutes = Math.floor(client.uptime / 60000) % 60
40 let seconds = Math.floor(client.uptime / 1000) % 60
41
42 // Latency Check
43 let webLatency = new Date() - interaction.createdAt
44 let apiLatency = client.ws.ping45 let totalLatency = webLatency + apiLatency
46
47 // Emoji
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);