Menu
×
   ❮     
HTML CSS JAVASCRIPT SQL PYTHON JAVA PHP HOW TO W3.CSS C C++ C# BOOTSTRAP REACT MYSQL JQUERY EXCEL XML DJANGO NUMPY PANDAS NODEJS DSA TYPESCRIPT ANGULAR ANGULARJS GIT POSTGRESQL MONGODB ASP AI R GO KOTLIN SASS VUE GEN AI SCIPY CYBERSECURITY DATA SCIENCE INTRO TO PROGRAMMING BASH RUST

JavaScript Basic

JS HOME JS Introduction JS Where To JS Output JS Syntax JS Statements JS Comments JS Variables JS Data Types JS Let JS Const JS Operators JS Arithmetic JS Assignment JS Functions JS Objects JS Events JS Strings JS String Templates JS Numbers JS Arrays JS Dates JS Math JS Booleans JS Comparisons JS Logical JS If Else JS Switch JS Loops JS Break JS Continue JS Errors JS Scope JS Code Blocks JS UTF-8 Characters

JS Advanced

JS Versions JS Statements JS Data Types JS String Methods JS Number Methods JS Date Formats JS Array Methods JS Functions JS Objects JS Classes JS Sets JS Maps JS Loops JS RegExp JS Callbacks JS Strict Mode JS DOM JS Window JS Web API JS AJAX JS JSON JS jQuery JS Graphics JS Examples

JS References

JavaScript Objects


JavaScript Statements

Statement Identifiers

JavaScript statements start with a statement identifier to identify the action to be performed.

Statement identifiers are reserved words (cannot be used as variable names or any other things).

Complete Statements Reference

Revised July 2025

Statement Description
{ } Creates an block of statements
async function Creates an AsyncFunction object
async function* Creates an AsyncGeneratorFunction object
await using Declares local variables that are asynchronously disposed
break Exits a switch or a loop
class Declares a class
const Declares a variable with a constant value
continue Breaks one iteration (in the loop) if a specified condition occurs, and continues with the next iteration in the loop
debugger Stops the execution of JavaScript, and calls (if available) the debugging function
do...while Executes a block of statements and repeats the block while a condition is true
for Loops through a block of code a number of times
for...in Loops through the properties of an object
for...of Loops through the values of an iterable object
for await...of Loops over async iterable objects
function Declares a function
function* Creates a GeneratorFunction object
if...else...else if Marks a block of statements to be executed depending on a condition
import Defines a read-only import of a module
import attributes Defines how a module should be loaded
let Declares a variable
return Stops the execution of a function (and returns a value)
switch Marks a block of statements to be executed depending on different cases
throw Throws (generates) an error
try...catch...finally Marks the block of statements to be executed when an error occurs in a try block, and implements error handling
using Declares local variables that are synchronously disposed
var Declares a variable
while Marks a block of statements to be executed while a condition is true
×

Contact Sales

If you want to use W3Schools services as an educational institution, team or enterprise, send us an e-mail:
sales@w3schools.com

Report Error

If you want to report an error, or if you want to make a suggestion, send us an e-mail:
help@w3schools.com

W3Schools is optimized for learning and training. Examples might be simplified to improve reading and learning. Tutorials, references, and examples are constantly reviewed to avoid errors, but we cannot warrant full correctness of all content. While using W3Schools, you agree to have read and accepted our terms of use, cookie and privacy policy.

Copyright 1999-2025 by Refsnes Data. All Rights Reserved. W3Schools is Powered by W3.CSS.