JavaScript Advanced Programming Chapter 3rd study record

Source: Internet
Author: User

3.1. Identifiers, built-in functions, objects according to the hump nomenclature; for example: Firstsecond;

3.2.ECMA5 introduces the strict mode concept, and the script uses strict mode to add "use strict" at the top of the document;

3.3. Strict mode can also be used inside the function;

function dosomething () {

"Use Strict"

function body

}

3.4. Keywords

Break,case,catch,continue,debugger (New in version Five), Default,delete,do,else,finally,for,function,if,in,

instanceof, new, return, switch, this, thow, try, typeof, Var, void, while, with;

3.5 Reserved words

Abstract, Boolean, Byte, Char, class, const, debugger, double, enum, export, extends, final, float, goto, implements, IM port, int, interface, long, native, package, private, protected, public,

Short, static, super, synchronized, throws, transient, volatile

3.6 5 Simple data types (base data type), Undefined, Null, Boolean, Number, String, 1 complex data types Object;

3.7 typeof detection data type;

3.8 Null value represents an empty object pointer, typeof detects null returned object;

The 3.9 undefined value is derived from a null value, so null = = undefined is true;

3.10. The transformation function Boolean () can convert any data type, returning a Boolean value;

3.11 Floating-point number, that is, the value must contain a decimal point, and must have at least one digit after the decimal points;

3.12 Because the memory that holds the floating-point value is twice times the integer value, ECMAScript converts the floating-point number to an integer value, such as: var floatNum1 = 1. No digits after the decimal point--resolves to 1

var floatnum = 10.0//integer--resolves to 10

3.13 Memory limit, ECMAScript minimum value is saved in Number.min_value-most browsers, this value is 5e-324; The maximum value that can be represented is saved in Number.MAX_VALUE-most browsers, The value is 1.7976931348623157e+308, and the value out of range is automatically converted to the Infinity value. To know if the value is poor, use Isfinite (), which returns True when the parameter is between the minimum and maximum values;

3.14 Nan is a non-numeric value (not a number) is a special value, and Nan is not equal to any value, including itself; the IsNaN () function determines whether it is a numeric value, and IsNaN () attempts to convert the value to a number after it receives one.

3.15 parseint (), if the first character is not a numeric character or minus sign, it returns Nan;parseint (convert content, convert cardinality)

3.16 numeric values, Boolean values, objects, and strings have the ToString () method, but in calling the ToString () method, you can pass a parameter: the cardinality of the output value; To convert a value to a string, you can use the plus operator to add it to a string;

An instance of the 3.17 object has properties and methods:

Constructor: Holds the function used to create the current object;

hasOwnProperty (PropertyName): Checks whether the property exists in the current object instance;

Ispropertyof (object): Checks whether the incoming object is a prototype of another object;

Propertyisenumberable (Peopertyname): Checks whether the property can be enumerated with for-in;

toLocaleString (): Returns the string representation of the object;

ToString (): Returns the string representation of the object;

ValueOf (): Returns the string, numeric value, and Boolean representation of the object, usually the same as the return value of the ToString () method;

When a 3.18 operator is applied to an object, the corresponding operator invokes the object's valueof () or ToString () method to obtain a value that can be manipulated;

3.19 When using the for-in loop, if the variable value of the object that represents the iteration is null or if the Undefined,for-in statement throws an error, ES5 corrects the behavior, which no longer throws an error, but simply does not execute the loop body. It is recommended to detect that the value of the object is not null or undefined before using the for-in loop;

3.20 es, any data type can be used in a switch statement, and the value of each case is not necessarily a constant, it can be a variable, or an expression; a switch statement uses a congruent operation when comparing values, so a type conversion does not occur (for example, the string ' 10 ' is not equal to the number 10)

The 3.21 Return statement can have no return value, in which case the function returns a undefined value after it has stopped executing;

JavaScript Advanced Programming Chapter 3rd study record

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.