Javascriptsome () function usage

Source: Internet
Author: User
This article mainly introduces the usage of some functions in detail, which is very practical. If you need them, you can refer to them.

This article mainly introduces the usage of some functions in detail, which is very practical. If you need them, you can refer to them.

Parameter description
Callback: the callback function to be executed for each array element.
ThisObject: this object defined when the callback function is executed.

Function Description
Execute a specified function (callback) for each element in the array until this function returns true. If this element is found, some returns true, if the callback function returns false after each element is executed, some returns false. It only executes the specified function for non-empty elements in the array, and no value is assigned or deleted elements are ignored.

The callback function can have three parameters: the current element, the index of the current element, and the current array object.

If the thisObject parameter is passed in, it will be used as the this object inside the callback function (callback). If it is not passed or is null, a global object will be used.

The Code is as follows:


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.