Returns a function which tests if every element in a typed array passes a test condition.
true
; otherwise, the function should return false
.true
if all elements pass the test and false
otherwise.false
if provided an empty typed array.false
is not provided a typed array.function to apply
a typed array function
var isOdd = require( `@stdlib/assert/is-odd` );
var arr1 = new Int32Array( [ 1, 3, 5, 7 ] );
var arr2 = new Int32Array( [ 1, 3, 5, 8 ] );
var validate = typedarrayfcn( isOdd );
var bool = validate( arr1 );
// returns true
bool = validate( arr2 );
// returns false
Predicate function.
array element
test result