math-array
Math utility to calculate with two arrays.
Install
$ npm install math-array
Usage
// Add 2 items // [4, 6] // [4, 5] // [4, 5] // Error, at least one array is required // Sub 2 items // Error, the first argument must be an array // [0, 1] // [0, 0] // Multiply 2 items // [1, 4] // Divide 2 items // Error, divide by zero
<method>(a, b, ensureNumber)
- a
Array.<Number>
- b
Array.<Number>
- ensureNumber
Boolean=false
math-array
manipulate arrays by simply adding, multiplying items. Iftrue
, the returned value will be cleaned, and every item which is not a number will be removed.
// [1, NaN] // [1, <1 empty item>]
License
MIT