UNPKG

nyo

Version:

A matrix library for JavaScript with ability to calculate determinants, transpose, inverse, RREF and other simple matrix operations

8 lines (7 loc) 247 B
const getDifferenceBetween = (arr1, arr2) => { if (arr1.length !== arr2.length) { throw new Error("Can't subtract rows with different lengths."); } return arr1.map((val, index) => val - arr2[index]); }; module.exports = getDifferenceBetween;