Array of common methods

Source: Internet
Author: User

In ECMAScript5, there are 5 iterative methods defined for the array, every (), filter (), ForEach (), map (), and some (), each of which accepts two parameters: the function to run on each item and, optionally, the scope object that runs the function-- The value that affects this. The functions passed in these methods receive three parameters: the value of the array item, the position of the item in the array, and the object itself. Depending on the method used, the return value after the function is executed may or may not affect the return value of the access.

Every ()

The Every () method is used to detect whether all elements of an array meet the specified criteria, to run the given function for each item in the array, and if an element is detected in the arrays that does not satisfy, the entire expression returns false, and the remaining elements are no longer instrumented and return true if all elements satisfy the condition.

Array of common methods

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.