and found an error in the sixth edition of the JavaScript definitive guide

Source: Internet
Author: User

PDF version, English version 158th page,

var IsArray = Function.isarray | | Function (o) {return typeof o = = = = "Object" &&object.prototype.tostring.call (o) = = = "[Object Array]";}; return typeof o = = = "Object" &&object.prototype.tostring.call (o) = = = "[Object Array]";};

Array.isarray is a function provided by ES5, this example is to implement this function in ES3, first, if the browser supports Array.isarray, it is assigned to IsArray, otherwise the subsequent function is assigned to IsArray. Therefore, the correct one should be:

var IsArray = Array.isarray | | Function (o) {return typeof o = = = "Object" && Object.prototype.toString.call (o) = = = "[Object Array]";};



and found an error in the sixth edition of the JavaScript definitive guide

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.