Home > Web Front-end > JS Tutorial > body text

What are the javascript statements?

藏色散人
Release: 2023-01-07 11:41:32
Original
2939 people have browsed it

Javascript statements include: 1. break statement, used to jump out of the loop; 2. catch statement, executed when an error occurs in the try statement block; 3. continue statement, used to skip one of the loops Iteration; 4. For statement, execute the code block a specified number of times, etc.

What are the javascript statements?

The operating environment of this article: windows7 system, javascript version 1.8.5, DELL G3 computer

What are the javascript statements?

JavaScript statement identifier

JavaScript statements usually start with a statement identifier and execute the statement.

Statement identifiers are reserved keywords and cannot be used as variable names.

The JavaScript statement identifiers (keywords) are listed below:

JavaScript Statement

break: used to break out of the loop.

catch: statement block, execute the catch statement block when an error occurs during the execution of the try statement block.

continue: Skip an iteration in the loop.

do ... while: Execute a statement block and continue executing the statement block when the conditional statement is true.

for: When the conditional statement is true, the code block can be executed a specified number of times.

for ... in: used to traverse the properties of an array or object (loop through the properties of an array or object).

function: Define a function

if ... else: Used to perform different actions based on different conditions.

return: exit function

switch: used to perform different actions based on different conditions.

throw: Throw (generate) error.

try: Implement error handling, used with catch.

var: declare a variable.

while: When the conditional statement is true, execute the statement block.

Recommended study: "javascript Advanced Tutorial"

The above is the detailed content of What are the javascript statements?. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!