JavaScript keywords are reserved words that define the language’s syntax and structures. These keywords cannot be used for other purposes in the code.
5 * 10 |
Expressions may also encompass variable values.
x * 10 |
Values within expressions can encompass various types, including numbers and strings.
For instance, “John” + ” ” + “Doe” results in the evaluation “John Doe”.
“John” + ” “ + “Doe” |
JavaScript keywords define actions to be executed, with let
specifically used to declare variables.
let x, y; |
Similarly, the var keyword directs the browser to create variables.
var x, y; x = 5 + 6; y = x * 10; |
Later in this tutorial, you’ll delve deeper into the distinctions between using var and let, although in these instances, they will yield identical outcomes. |
In JavaScript, not every statement is executed; content after double slashes //
or enclosed in /*
and */
is considered a comment. These comments are ignored and do not execute.
let x = 5; // I will be executed // x = 6; I will NOT be executed |