README
isPositiveNumberArray
Test if a value is an array-like object containing only positive numbers.
Installation
npm install @stdlib/assert-is-positive-number-array
Usage
var isPositiveNumberArray = require( '@stdlib/assert-is-positive-number-array' );
isPositiveNumberArray( value )
Tests if a value
is an array-like object containing only positive numbers.
var Number = require( '@stdlib/number-ctor' );
var bool = isPositiveNumberArray( [ 3.0, new Number(3.0) ] );
// returns true
bool = isPositiveNumberArray( [ 3.0, '3.0' ] );
// returns false
isPositiveNumberArray.primitives( value )
Tests if a value
is an array-like object array
containing only primitive positive numbers.
var Number = require( '@stdlib/number-ctor' );
var bool = isPositiveNumberArray.primitives( [ 1.0, 5.0, 10.0 ] );
// returns true
bool = isPositiveNumberArray.primitives( [ 3.0, new Number(1.0) ] );
// returns false
isPositiveNumberArray.objects( value )
Tests if a value
is an array-like object array
containing only object positive numbers.
var Number = require( '@stdlib/number-ctor' );
var bool = isPositiveNumberArray.objects( [ new Number(1.0), new Number(1.0) ] );
// returns true
bool = isPositiveNumberArray.objects( [ 1.0, 5.0, 10.0 ] );
// returns false
Examples
var Number = require( '@stdlib/number-ctor' );
var isPositiveNumberArray = require( '@stdlib/assert-is-positive-number-array' );
var bool = isPositiveNumberArray( [ 5.0, 0.2, 3.9 ] );
// returns true
bool = isPositiveNumberArray( [ 1, 2, 3 ] );
// returns true
bool = isPositiveNumberArray( [ 1, new Number( 6 ), 3 ] );
// returns true
bool = isPositiveNumberArray( [ 0, 2, 4 ] );
// returns false
bool = isPositiveNumberArray( [ 1, 'abc', 3 ] );
// returns false
bool = isPositiveNumberArray( 78.0 );
// returns false
Notice
This package is part of stdlib, a standard library for JavaScript and Node.js, with an emphasis on numerical and scientific computing. The library provides a collection of robust, high performance libraries for mathematics, statistics, streams, utilities, and more.
For more information on the project, filing bug reports and feature requests, and guidance on how to develop stdlib, see the main project repository.
Community
License
See LICENSE.
Copyright
Copyright © 2016-2021. The Stdlib Authors.