Function Namespace Pot.every
Defined in: <pot.js>.
| Constructor Attributes | Constructor Name and Description |
|---|---|
|
Pot.every(object, callback, (context))
Tests whether all elements in the object pass the
test implemented by the provided function.
|
Function Namespace Detail
Pot.every(object, callback, (context))
Tests whether all elements in the object pass the
test implemented by the provided function.
This method like Array.prototype.every
function isBigEnough(value, index, array) {
return (value >= 10);
}
var passed = Pot.every([12, 5, 8, 130, 44], isBigEnough);
// passed is false
passed = Pot.every([12, 54, 18, 130, 44], 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.