
JavaScript
iteye_5908
这个作者很懒,什么都没留下…
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
JavaScript boolean false
[size=medium]If a number is used where a boolean value is expected, the number is converted to TRue unless thenumber is 0 or NaN , which are converted to false . If a string is used where a boolean ...原创 2009-01-01 17:25:35 · 139 阅读 · 0 评论 -
The constructor Property
[size=medium]Since constructor functions define new categories or classes of objects, the constructor property can helpdetermine the type of an object. For example, you might use code like the follo...原创 2009-01-05 17:51:51 · 141 阅读 · 0 评论 -
The toLocaleString() Method
[size=medium]In ECMAScript v3 and JavaScript 1.5, the Object class defines a toLocaleString() method in addition toits toString() method. The purpose of this method is to return a localized string r...原创 2009-01-05 18:02:34 · 235 阅读 · 0 评论 -
The valueOf() Method
[size=medium] JavaScript calls thismethod automatically if an object is used in a context where a primitive value is ...原创 2009-01-05 18:05:38 · 151 阅读 · 0 评论 -
Reading and Writing Array Elements
Note that array indexes must be integers greater than or equal to 0 and less than 232 -1. If you use anumber that is too large, a negative number, or a floating-point number (or a boolean, an object...原创 2009-01-05 22:00:44 · 123 阅读 · 0 评论 -
Deleting Array Elements
The delete operator sets an array element to the undefined value, but the element itself continues toexist. To actually delete an element, so that all elements above it are shifted down to lower inde...原创 2009-01-05 22:11:51 · 171 阅读 · 0 评论 -
Nested Functions
Nested functions may be defined only at the top level of the function within which they are nested. Thatis, they may not be defined within statement blocks, such as the body of an if statement or whi...原创 2009-01-06 21:09:11 · 223 阅读 · 0 评论 -
Function Literals
Although function literals create unnamed functions, the syntax allows a function name to be optionallyspecified, which is useful when writing recursive functions that call themselves. For example:...原创 2009-01-06 21:50:51 · 165 阅读 · 0 评论 -
Variable-Length Argument Lists: The Arguments Obje
The Arguments object has one very unusual feature. When a function has named arguments, the arrayelements of the Arguments object are synonyms for the local variables that hold the function arguments...原创 2009-01-06 23:06:39 · 134 阅读 · 0 评论 -
The callee Property
In addition to its array elements, the Arguments object defines a callee property that refers to thefunction that is currently being executed. This property is rarely useful, but it can be used to al...原创 2009-01-07 00:02:42 · 127 阅读 · 0 评论 -
Functions as Methods
When a function is invoked as a function rather that as a method, the this keyword refers to the globalobject. Confusingly, this is true even when a nested function is invoked (as a function) within ...原创 2009-01-07 00:39:40 · 159 阅读 · 0 评论 -
Constructor Functions
the new operatorcreates a new object and then invokes the constructor function, passing the newly created object as thevalue of the this keyword.原创 2009-01-07 00:42:43 · 227 阅读 · 0 评论 -
Private properties with closures
//// This function adds property accessor methods for a property with // the specified name to the object o. The methods are named get<name>// and set<name>. If a predicate function i...原创 2009-01-07 13:13:37 · 136 阅读 · 0 评论 -
Breakpoints using closures
// // This function implements a breakpoint. It repeatedly prompts the user// for an expression, evaluates it with the supplied self-inspecting closure,// and displays the result. It is the closur...原创 2009-01-07 13:43:20 · 126 阅读 · 0 评论 -
the empty statement
[size=medium]When you intentionally use the empty statement, it is a good idea to comment your code in a way thatmakes it clear that you are doing it on purpose. For example:[code="javascript"]for...原创 2009-01-05 00:29:39 · 156 阅读 · 0 评论 -
with
[size=medium]The with statement is used to temporarily modify the scopechain. It has the following syntax:[code="javascript"]with (object) statement[/code]This statement effectively adds ob...原创 2009-01-05 00:27:26 · 109 阅读 · 0 评论 -
Object Conversions
[size=medium]When a non-null object is used in a Boolean context, it converts to true . When an object is used in astring context, JavaScript calls the toString( ) method of the object and uses the ...原创 2009-01-01 19:09:11 · 145 阅读 · 0 评论 -
Primitive Types and Reference Types
[size=medium]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 t...原创 2009-01-02 10:55:32 · 208 阅读 · 0 评论 -
Variable Declaration
[size=medium]Variables declared with var are permanent : attempting to delete them with the delete operator causesan error.If you attempt to read the value of an undeclared variable, JavaScript ...原创 2009-01-02 12:53:19 · 464 阅读 · 0 评论 -
No block scope
[size=medium]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....原创 2009-01-02 14:11:43 · 106 阅读 · 0 评论 -
The Global Object
[size=medium]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 globa...原创 2009-01-02 20:59:57 · 104 阅读 · 0 评论 -
Local Variables: The Call Object
[size=medium]If global variables are properties of the special global object, then what are local variables? They too areproperties of an object. This object is known as the call object . The call...原创 2009-01-02 23:33:23 · 130 阅读 · 0 评论 -
switch
[size=medium]The switch statement first evaluates the expression that follows the switch keyword and then evaluatesthe case expressions, in the order in which they appear, until it finds a value tha...原创 2009-01-04 20:39:59 · 112 阅读 · 0 评论 -
for/in loop
[size=medium]JavaScript arrays are simply a specialized kind of object. Therefore, the for/in loop enumerates arrayindexes as well as object properties.The for/in loop does not specify the order...原创 2009-01-04 22:53:05 · 168 阅读 · 0 评论 -
Labels
[size=medium]Label names aredistinct from variable and function names, so you do not need to worry about name collisions if you give alabel the same name as a variable or function.When break i...原创 2009-01-04 23:01:58 · 149 阅读 · 0 评论 -
functions
[size=medium]Technically speaking, the function statement is not a statement. Statements cause dynamic behavior in aJavaScript program, while function definitions describe the static structure of a ...原创 2009-01-04 23:48:51 · 98 阅读 · 0 评论 -
return
[size=medium]If a function executes a return statement with no expression , or if it returns because it reaches the endof the function body, the value of the function-call expression is undefined ....原创 2009-01-04 23:52:37 · 143 阅读 · 0 评论 -
throw
[size=medium]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 instanceof one of the su...原创 2009-01-04 23:56:59 · 110 阅读 · 0 评论 -
try/catch/finnaly
[size=medium]If control leaves the try block because of a return , continue , orbreak statement, the finally block is executed before control transfers to its new destination.If a finally bloc...原创 2009-01-05 00:17:54 · 175 阅读 · 0 评论 -
Extending Built-in Types
The Function.apply( ) method is missing in Microsoft Internet Explorer 4 and 5. This is a prettyimportant function, and you may see code like this to replace it: // IE 4 & 5 don't implement F...原创 2009-01-08 13:55:44 · 184 阅读 · 0 评论