function _mapMultiple (Arrays, multiCallback) {
    if (typeof multiCallback !== 'function') {
      throw new Error('Last argument must be a callback function')
    }

    const firstArrayIsMatrix = Arrays[0].isMatrix

    const newSize = broadcastSizes(...Arrays.map(M => M.isMatrix ? M.size() : arraySize(M)))

    const _get = firstArrayIsMatrix
      ? (matrix, idx) => matrix.get(idx)
      : get

    const broadcastedArrays = firstArrayIsMatrix
      ? Arrays.map(M => M.isMatrix
        ? M.create(broadcastTo(M.toArray(), newSize), M.datatype())
        : Arrays[0].create(broadcastTo(M.valueOf(), newSize)))
      : Arrays.map(M => M.isMatrix
        ? broadcastTo(M.toArray(), newSize)
        : broadcastTo(M, newSize))

    let callback

    if (typed.isTypedFunction(multiCallback)) {
      const firstIndex = newSize.map(() => 0)
      const firstValues = broadcastedArrays.map(array => _get(array, firstIndex))
      const callbackCase = _getTypedCallbackCase(multiCallback, firstValues, firstIndex, broadcastedArrays)
      callback = _getLimitedCallback(callbackCase)
    } else {
      const numberOfArrays = Arrays.length
      const callbackCase = _getCallbackCase(multiCallback, numberOfArrays)
      callback = _getLimitedCallback(callbackCase)
    }

    const broadcastedArraysCallback = (x, idx) =>
      callback(
        [x, ...broadcastedArrays.slice(1).map(Array => _get(Array, idx))],
        idx)

    if (firstArrayIsMatrix) {
      return broadcastedArrays[0].map(broadcastedArraysCallback)
    } else {
      return _mapArray(broadcastedArrays[0], broadcastedArraysCallback)
    }

    function _getLimitedCallback (callbackCase) {
      switch (callbackCase) {
        case 0:
          return x => multiCallback(...x)
        case 1:
          return (x, idx) => multiCallback(...x, idx)
        case 2:
          return (x, idx) => multiCallback(...x, idx, ...broadcastedArrays)
      }
    }

    function _getCallbackCase (callback, numberOfArrays) {
      if (callback.length > numberOfArrays + 1) { return 2 }
      if (callback.length === numberOfArrays + 1) { return 1 }
      return 0
    }

    function _getTypedCallbackCase (callback, values, idx, arrays) {
      if (typed.resolve(callback, [...values, idx, ...arrays]) !== null) { return 2 }
      if (typed.resolve(callback, [...values, idx]) !== null) { return 1 }
      if (typed.resolve(callback, values) !== null) { return 0 }
      // this should never happen
      return 0
    }
  }
Maps over multiple arrays or matrices.

@param {Array<Array|Matrix>} Arrays - An array of arrays or matrices to map over.
@param {function} multiCallback - The callback function to apply to each element.
@throws {Error} If the last argument is not a callback function.
@returns {Array|Matrix} A new array or matrix with each element being the result of the callback function.

@example
_mapMultiple([[1, 2, 3], [4, 5, 6]], (a, b) => a + b); // Returns [5, 7, 9]