Tests whether every own property of an object fails a test implemented by a predicate function.
var noneOwnBy = require( '@stdlib/utils/none-own-by' );
Tests whether every own
property of an object fails a test implemented by a predicate
function.
function isUnderage( age ) {
return ( age < 18 );
}
var obj = {
'a': 28,
'b': 22,
'c': 25
};
var bool = noneOwnBy( obj, isUnderage );
// returns true
If a predicate
function returns a truthy value, the function immediately returns false
.
function isUnderage( age ) {
return ( age < 18 );
}
var obj = {
'a': 12,
'b': 22,
'c': 25
};
var bool = noneOwnBy( obj, isUnderage );
// returns false
-
If the 1st argument is not an object or the second argument is not a fuction , the function throws a Type Error.
-
If provided an empty object, the function returns
true
.function truthy() { return true; } var bool = noneOwnBy( {}, truthy ); // returns true
var noneOwnBy = require( '@stdlib/utils/none-own-by' );
function isUnderage( age ) {
return age < 18;
}
var obj = {
'a': 26,
'b': 20,
'c': 25
};
var bool = noneOwnBy( obj, isUnderage );
// returns true
@stdlib/utils/any-own-by
: test whether whether any 'own' property of a provided object satisfies a predicate function.@stdlib/utils/every-own-by
: test whether all own properties of an object pass a test implemented by a predicate function.@stdlib/utils/for-own
: invoke a function for each own enumerable property of an object.@stdlib/utils/none-by
: test whether all elements in a collection fail a test implemented by a predicate function.@stdlib/utils/some-own-by
: test whether someown
properties of a provided object satisfy a predicate function for at leastn
properties.