In JavaScript, variables must be identified with a unique identifier.
let blank;
The identifier of the variable in the above example is “blank”.
There are a few rules in regards to assigning variables’ identifiers (in other words, rules for naming variables in JavaScript).
The following are examples of acceptable identifiers(aka names):
let monthlyRent = 600;
let carNote$ = 300;
let home_address = "789 Super Fun Ln.";
let businessAddress2 = "326 City Rd.";
let lunchTotal$ = 11.49;
You probably noticed that the examples above are assigned to different types of data, as some store numbers while others store text.
Next, we are going to discuss the different data types a variable can store.
See the Pen Exercise 1.2 by LSU DDEM (@lsuddem) on CodePen.