tailieunhanh - JavaScript Bible, Gold Edition part 22

JavaScript Bible, Gold Edition part 22. This book will bring programmers and non-technical professionals, including casual programmers and scripters, painlessly up to speed on all aspects of mastering JavaScript. Key topics include programming fundamentals, JavaScript language elements and how to use them effectively, and how to easily and efficiently add powerful new functionality to HTML documents and Java applets. | 58 Part III Document Objects Reference any of the built-in objects plus the new operator. For example the following expression generates a String object and returns a reference to that object new StringCHello Table 13-1 lists the built-in objects with which scripters come in contact. Table 13-1 JavaScript Built-in Objects Array1 Boolean Date Error2 EvalError2 Function1 Math Number1 Object1 RangeError2 ReferenceError2 RegExp3 String1 SyntaxError2 TypeError2 URIError2 1Although defined in ECMA Level 1 was first available in NN3 and IE3 J2 2Defined in ECMA Level 3 implemented in NN6 3Defined in ECMA Level 3 implemented fully in NN4 partially in IE4 JavaScript is loosely typed. Variables arrays and function return values are not defined to be of any particular data type. In fact an initialized variable can hold different data type values in subsequent script statements obviously not good practice but possible nonetheless . Similarly an array may contain values of multiple types. The range of built-in data types is intentionally limited Boolean true or false Null Number double-precision 64-bit format IEEE 734 value Object encompassing the Array object String Undefined The host environment defines global scope. Web browsers traditionally define a browser window or frame to be the global context for script statements. When a document unloads all global variables defined by that document are destroyed. JavaScript variables have either global or local scope. A global variable in a Web browser is typically initialized in var statements that execute as the document loads. All statements in that document can read or write that global variable. A local variable is initialized inside a function also with the var operator . Only statements inside that function may access that local variable. Scripts sometimes access JavaScript static object properties and methods. Some static objects encourage direct access to their properties or methods. For Chapter 13 JavaScriptEssentials 59 .

TỪ KHÓA LIÊN QUAN