Array de-weight

Source: Internet
Author: User

Tag: false element This copies the ISA back to Dex BSP Basic

Normal array de-weight--using filter

Filter () Basic syntax:

Arr.filter (Callback[,thisarg])

Callback the function used to test each element of an array. Calling when using a parameter (Element,index.array) returns true to preserve the element (test pass), false is not preserved.

Three parameters passed in when the callback is invoked:

1. The value of the element, the index of the 2 element, and the 3 traversed array

Thisarg is optional. The value to use for this when executing callback.

Filter does not change the original array.

The range of elements traversed by the filter is determined before the first call to callback. Elements that are added to the array after the call to filter are not traversed by the filter. If the already existing elements are changed, the value they pass into the callback is the value that the filter iterates over to their moment. Elements that have been deleted or that have never been copied are not traversed.

For general arrays, use the filter to redo the example:

Array de-weight

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.