dojo.some
<script src="../../js/dojo.js"></script>
defined in dojo/_base/array.js
This function corresponds to the JavaScript 1.6 Array.some() method. In environments that support JavaScript 1.6, this function is a passthrough to the built-in method. For more details, see:
Usage
parameter | type | description |
---|---|---|
arr | Array|String | the array to iterate on. If a string, operates on individual characters. |
callback | Function|String | a function is invoked with three arguments: item, index, and array and returns true if the condition is met. |
thisObject | Object | Optional. may be used to scope the call to callback |
Examples
Example 1
dojo.some([1, 2, 3, 4], function(item){ return item>1; });
Example 2
dojo.some([1, 2, 3, 4], function(item){ return item