MCPcopy Index your code
hub / github.com/josdejong/mathjs / generalize

Function generalize

src/utils/array.js:601–615  ·  view source on GitHub ↗
(a)

Source from the content-addressed store, hash-verified

599 * @return {array} An array of values without identifiers
600 */
601export function generalize (a) {
602 if (!Array.isArray(a)) {
603 throw new TypeError('Array input expected')
604 }
605
606 if (a.length === 0) {
607 return a
608 }
609
610 const b = []
611 for (let i = 0; i < a.length; i++) {
612 b.push(a[i].value)
613 }
614 return b
615}
616
617/**
618 * Check the datatype of a given object

Callers 3

array.test.jsFile · 0.90
setDifference.jsFile · 0.90
setIntersect.jsFile · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…