Loading lesson path
Syntax are the rules how programs must be constructed: // How to Declare variables:
let x = 5;
let y = 6;// How to Compute values:
let z = x + y;// I am a Comment. I do Nothing
The JavaScript syntax defines two types of values:
(Fixed values)
(Variable values)
(fixed values) are: Numbers are written with or without decimals:
10.50 1001 Strings are text, written within double or single quotes:
"John Doe" 'John Doe' JavaScript Keywords keywords are used to defines actions to be performed. The let and const keywords create variables:
let x = 5;
const fname = "John";Formula
JavaScript keywords are case - sensitive.or
Let as the keyword let.Variables are containers for storing data values. Variables must be identified with unique names.
// Define x as a variable let x;
// Assign the value 6 to x x = 6;An identifier is the name you give to a variable.
Must start with a letter, _, or $
Cannot be a reserved keyword (let, const, if, etc.)(=) assign values to variables:
let x = 5;
let y = 6;
let sum = x + y;( +
Formula
5 * 10An expression is a combination of values, variables, and operators, which computes to a value.
Formula
(5 + 6) * 10 evaluates to 110:
(5 + 6) * 10Formula
x * 10"John" + " " + "Doe", evaluates to "John Doe": "John" + " " + "Doe"