mathjs
Version:
Math.js is an extensive math library for JavaScript and Node.js. It features a flexible expression parser and offers an integrated solution to work with numbers, big numbers, complex numbers, units, and matrices.
19 lines (16 loc) • 477 B
JavaScript
;
var isCollection = require('./isCollection');
/**
* Test whether an array contains collections
* @param {Array} array
* @returns {boolean} Returns true when the array contains one or multiple
* collections (Arrays or Matrices). Returns false otherwise.
*/
module.exports = function containsCollections (array) {
for (var i = 0; i < array.length; i++) {
if (isCollection(array[i])) {
return true;
}
}
return false;
};