lynx   »   [go: up one dir, main page]

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

Basic JavaScript

JS Tutorial JS Syntax JS Variables JS Operators JS If Conditions JS Loops JS Strings JS Numbers JS Functions JS Objects JS Dates JS Arrays JS Sets JS Maps JS Math JS RegExp JS Data Types JS Errors JS Debugging JS Events JS Programming JS References JS UTF-8 Characters JS Versions

JS Advanced

JS Functions JS Objects JS Classes JS Iterations JS Promises JS Modules JS HTML DOM JS Windows JS Web API JS AJAX JS JSON JS jQuery JS Graphics JS Examples JS 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.

Лучший частный хостинг