The essence of JavaScript's authoritative guide (ii)

Source: Internet
Author: User

    1. in the In ECMAScript5 , the comma after the last attribute in the object's direct volume is ignored, and the comma can be ignored in most implementations of ECMASCRIPT3, but in IE it is an error.

    2. The delete operation simply disconnects the property from the host object and does not manipulate the properties in the property. the Delete operation can only delete its own property and cannot delete the inherited property (the inherited property must be removed from the prototype object that defines the property, and this affects all objects that inherit from the prototype)

    3. hasOwnProperty() amplification is used to detect whether a given name is an object's own property. For inherited properties it returns false

650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M01/4C/9C/wKiom1RBBSOBq3JgAABaIaChwR8619.jpg "title=" 1 (2). PNG "alt=" wkiom1rbbsobq3jgaabaiachwr8619.jpg "/>

  1. JSON: All called javascriptobject Notation, which is the Javascript Object Notation

  2. object serialization is a value that converts the state of an object to a string, or restores a string to an object . ECMAScript5 provides built-in functions json.stringify() and Json.parse () to serialize and restore Javascript objects. These methods all use JSON as the data Interchange format.

  3. all the Javascript objects inherit properties from Object.prototype (except those created by the prototype display). These inheritance properties are primarily methods, because Javascript programmers are generally more interested in inheritance methods.

  4. toLocaleString(), this method returns a localized string representing the object. the default tolocalstring() method in Object does not do anything to localize itself, it only calls the ToString() method and returns the corresponding value. the date and number classes have been customized for the tolocalstring() method, and can be used to localize conversions of numbers, dates, and times. the toLocaleString() method of the array class resembles the ToString() method, and the only difference is that each array element calls tolocalstring The () method is converted to a string instead of calling the respective toString() method.

  5. The difference between toString() and tolocalestring():

1)tolocalestring returns a different result depending on the region, and its date format is determined by the "Regional Settings" in the user's control panel. For example, the same is 1 months 5 days, in the United States,tolocalestring may return "01/05/96 00:00:00", while in Europe, the return value may be "05/ 01/96 00:00:00 ", because the European Convention is to put the date in front of the month.

2) When working with arrays,tolocalestring calls the method on each element of the array, and ToString calls the ToString method


This article is from "Tiger Brother's Blog" blog, please be sure to keep this source http://7613577.blog.51cto.com/7603577/1565277

The essence of JavaScript's authoritative guide (ii)

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.