JavaScript statements usually begin with a keyword that specifies the action to be performed. The Reserved Words Reference lists all JavaScript keywords, including those you’ll encounter in this tutorial.
Keyword |
Description |
var |
Define a variable |
let |
Defines a block-scoped variable. |
const |
Define a block constant |
if |
Indicates a block of statements to be executed conditionally. |
switch |
Indicate a block of statements to be executed in different cases |
for |
Designates a block of statements to be iteratively executed within a loop. |
function |
Declares a function |
return |
Terminates a function. |
try |
Incorporates error handling for a block of statements. |