JavaScript: The Definitive Guide, Sixth Editio javaScript权威指南(第6版) pdf 文字版-文字版, javascript电子书, 和javascript 有关的电子书:

5.8 Summary of JavaScript Statements

5.8 Summary of JavaScript Statements


This chapter introduced each of the JavaScript language’s statements. Table 5-1 summarizes them, listing the syntax and purpose of each.

Table 5-1. JavaScript statement syntax

Statement Syntax Purpose

break break [label]; Exit from the innermost loop or switchor from named enclosing statement case case expression: Label a statement within a switch continue continue [label]; Begin next iteration of the innermost loop or the named loop debugger debugger; Debugger breakpoint default default: Label the default statement within a switch do/while do statement while (expression); An alternative to the whileloop empty ; Do nothing for for(init; test; incr) statement An easy-to-use loop for/in for (var in object) statement Enumerate the properties of object function function name([param[,...]]) { body } Declare a function named name if/else if (expr) statement1 [else statement2] Execute statement1or statement2 label label: statement Give statementthe name label return return [expression]; Return a value from a function switch switch (expression) { statements } Multiway branch to caseor default:labels throw throw expression; Throw an exception try try { statements } Handle exceptions

[catch { handler statements }]

[finally { cleanup statements }]

Statement Syntax Purpose
use strict "use strict"; Apply strict mode restrictions to script or function
var var name [ = expr] [ ,... ]; Declare and initialize one or more variables
while while (expression) statement A basic loop construct
with with (object) statement Extend the scope chain (forbidden in strict mode)

5.8 Summary of JavaScript Statements | 113

欢迎转载,转载请注明来自一手册:http://yishouce.com/book/1/27637.html
友情链接It题库(ittiku.com)| 版权归yishouce.com所有| 友链等可联系 admin#yishouce.com|粤ICP备16001685号-1