`
pstinghua
  • 浏览: 24079 次
  • 性别: Icon_minigender_1
  • 来自: 北京
最近访客 更多访客>>
社区版块
存档分类
最新评论
文章列表

with

[size=medium]The with statement is used to temporarily modify the scope chain. It has the following syntax: with (object) statement This statement effectively adds object to the front of the scope chain, executes statement , and then restores the scope chain to its original state. Despite its o ...

try/catch/finnaly

If control leaves the try block because of a return , continue , or break statement, the finally block is executed before control transfers to its new destination. If a finally block itself transfers control with a return , continue , break , or throw statement, or by calling a method that throws a ...

throw

The tHRow statement has the following syntax: throw expression; expression may evaluate to a value of any type. Commonly, however, it is an Error object or an instance of one of the subclasses of Error. It can also be useful to throw a string that contains an error message, or a numeric value that re ...

return

If a function executes a return statement with no expression , or if it returns because it reaches the end of the function body, the value of the function-call expression is undefined . Because of JavaScript's automatic semicolon insertion, you may not include a line break between the return keyword ...
[size=medium]Technically speaking, the function statement is not a statement. Statements cause dynamic behavior in a JavaScript program, while function definitions describe the static structure of a program. Statements are executed at runtime, but functions are defined when JavaScript code is parsed, ...

Labels

Label names are distinct from variable and function names, so you do not need to worry about name collisions if you give a label the same name as a variable or function. When break is used with a label, it jumps to the end of, or terminates, the named statement, which may be any enclosing statement. ...
JavaScript arrays are simply a specialized kind of object. Therefore, the for/in loop enumerates array indexes as well as object properties. The for/in loop does not specify the order in which the properties of an object are assigned to the variable. There is no way to tell what the order will be in ...

switch

The switch statement first evaluates the expression that follows the switch keyword and then evaluates the case expressions, in the order in which they appear, until it finds a value that matches. The matching case is determined using the === identity operator, not the == equality operator, so the ex ...
If global variables are properties of the special global object, then what are local variables? They too are properties of an object. This object is known as the call object . The call object has a shorter lifespan than the global object, but it serves the same purpose. While the body of a function ...
When the JavaScript interpreter starts up, one of the first things it does, before executing any JavaScript code, is create a global object . The properties of this object are the global variables of JavaScript programs. When you declare a global JavaScript variable, what you are actually doing is d ...
Note that unlike C, C++, and Java, JavaScript does not have lock-level scope. All variables declared in a function, no matter where they are declared, are defined throughout the function. it is good programming practice to place all your variable declarations together at the start of any function.
Variables declared with var are permanent : attempting to delete them with the delete operator causes an error. If you attempt to read the value of an undeclared variable, JavaScript generates an error. If you assign a value to a variable that you have not declared with var , JavaScript implicitly d ...
Numbers and booleans are primitive types in JavaScriptprimitive because they consist of nothing more than a small, fixed number of bytes that are easily manipulated at the low levels of the JavaScript interpreter. Objects, on the other hand, are reference types. Arrays and functions, which are specia ...
When a non-null object is used in a Boolean context, it converts to true . When an object is used in a string context, JavaScript calls the toString( ) method of the object and uses the string value returned by that method. When an object is used in a numeric context, JavaScript first calls the value ...
If a number is used where a boolean value is expected, the number is converted to TRue unless the number is 0 or NaN , which are converted to false . If a string is used where a boolean value is expected, it is converted to true except for the empty string, which is converted to false . null and the ...
Global site tag (gtag.js) - Google Analytics