By Guil Hernandez
const daysInWeek = 7;
in the same way as this:
Even the same as this:
A good rule of thumb is: use space to make your code easier to read and understand. Too much space, like the bottom example, can be distracting. Too little space and your code can be harder to read because the letters and symbols are squashed together.
Many programmers like to add space to make the code easier to understand. That's why including a space on either side of the = sign is the most common approach.
The space makes it clear that the name, = sign, and value are distinct pieces of the statement.
There are times, however, when space is necessary. For example, to create a variable, you use the const keyword followed by a name for that variable.
constdaysInWeek = 7;
Likewise, do not add spaces in the middle of a variable name, because the browser will see each word as a separate identifier. For example, the following produces a syntax error.
const days In Week = 7;