vimwiki

Javascript variables

Declaration

Declare a variable with the keyword let (or var).

let myVariable;

let otherVariable = 3;

Use camelCase for the variables names

Constant

Declare a constant with the keyword const.

const five = 5;

It is good practice to use constants to alias values difficult to remember that are known prior to execution.

In that case use Uppercase snake_case for the name.

const COLOR_RED = "#F00"