READ: The JavaScript authoritative guide (notes)

Source: Internet
Author: User
Tags readable

Determine if the type is Nan: x! =x//true if and only if X is Nan, X is not equal to itself.

Returns True if the IsNaN ()//ture parameter is Nan or not a numeric value. False to determine whether to break the number and string numbers (such as: "3");

JS Digital Precision value is very close to 0.1, such as: 0.411-0.401, expected result 0.01, the actual result is 0.009999999999999953; through the "\" symbolic connection string, stitching HTML strings more concise, more efficient;

If the parseint and parsefloat parameters are strings, the string can only start with spaces and numbers, otherwise it resolves to nan and can only parse coherent numbers, such as: parseint ("12abc")//12,parseint ("abc111")// Nan,parseinf ("1a2b3c")//1,parseinf ("1 2")//1;

ToString or valueof converts the object to the original value, but most objects cannot really represent the original value, at which point the ValueOf method returns the object itself;

Variables defined by Var can be enumerated, readable and writable, but not configurable, so, can not be deleted by delete;

Typically, NULL represents an expected null value, while undefined represents an unexpected, unpredictable null value;

The "," operator, which returns the second operand, such as continuous use, returns the last operand, such as: 1,2,3//3;

In general, functions and executable objects can detect "function" with typeof, but before IE9, the checkout result of non-native executable object is "object";

With (o) x = 1, if x is present in the O object, it is assigned a value of 1, otherwise the WITH statement does not play any role, and X is hung under the Window object (if no x exists) and is assigned a value of 1. In strict mode, the use of with is forbidden;

Strict mode (ES5): Disable with,

A variable must be declared before a reference error exception is thrown.

Arguments no longer references a function's parameter address, but a copy of the parameter,

Using Arguments.caller and Arguments.callee will throw an exception,

See the JavaScript Authority Guide (Sixth Edition) 5.7.3 "Use strict";

Property Description (Read-Write enumeration configuration) is true before ES5, non-configurable, ES5 and later configurable;

JS cannot modify its prototype chain object (A/b.prototype) by object (b), can use this, implement the Inherit function, create an empty object (B) that inherits the target object (a) to do something instead of a, thus avoiding a being accidentally modified, the Inherit function is as follows:
function inherit (obj) {
...//Ensure that obj is a non-null object
if (object.create) {//es5+
return Object.create (obj)
}ELSE{//ES5 below, create an inheritance relationship with the new function
function f () {}
F.prototype = obj
return new F ()
}
}

Object.key and Object.getownpropertynames (ES5), Object.key () returns the collection of enumerable own property names A,object.getownpropertynames () Returns a collection of all its own property names B,a is a subset of B;

Getter, Setter (ES5), attribute description does not have writable this, only getter, then readable, only setter, then writable, both have, then can read and write;

Getprototypeof (ES5) and setprototypeof (ES6) are from object objects, for their private properties, are not inheritable, and cannot be found on the object prototype chain, so, general, Can only be called by object.getprototypeof/setprototypeof, while isPrototypeOf (ES5) is from the root object (Object.prototype) and can be inherited, so Can be used directly with any object a.isprototypeof;

     

READ: The JavaScript authoritative guide (notes)

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.