Same Line Declarations
To keep your code concise, JavaScript allows you to declare multiple variables using a single let, const, or var keyword by separating the variable names with commas.
Syntax
Instead of dedicating a new line and keyword for every variable:
let miles = 80276;
let org = "Tesla";
You can consolidate them onto one line:
let miles = 80276, org = "Tesla";
This behavior works identically for variables that are assigned initial values and those that are left undefined.
Practical Example
Declaring related configuration values on the same line can group them logically and save vertical space in the script.
// Declaring related analytics configuration on a single line
const averageOpenRate = 0.23, displayMessage = "is the average open rate of your messages before they're logged.";
console.log("Average open rate:", averageOpenRate);
console.log("Display message:", displayMessage);