Function Namespace Pot.some
Defined in: <pot.js>.
Constructor Attributes | Constructor Name and Description |
---|---|
Pot.some(object, callback, (context))
Tests whether some element in the object passes the
test implemented by the provided function.
|
Function Namespace Detail
Pot.some(object, callback, (context))
Tests whether some element in the object passes the
test implemented by the provided function.
This method like Array.prototype.some
function isBigEnough(value, index, array) { return (value >= 10); } var passed = Pot.some([2, 5, 8, 1, 4], isBigEnough); // passed is false passed = Pot.some([12, 5, 8, 1, 4], isBigEnough); // passed is true
- Parameters:
- {Array|Object|*} object
- A target object.
- {Function} callback
- A callback function.
- {*} (context)
- (Optional) Object to use as `this` when executing callback.
- Returns:
- {Boolean} Return the Boolean result by callback.