function _recursive (arr, dim) {
    if (isMatrix(arr)) {
      arr = arr.toArray() // Makes sure arrays like [ matrix([0, 1]), matrix([1, 0]) ] are processed properly
    }
    if (!Array.isArray(arr)) {
      throw RangeError('Array/Matrix does not have that many dimensions')
    }
    if (dim > 0) {
      const result = []
      arr.forEach(element => {
        result.push(_recursive(element, dim - 1))
      })
      return result
    } else if (dim === 0) {
      return _diff(arr)
    } else {
      throw RangeError('Cannot have negative dimension')
    }
  }
Recursively find the correct dimension in the array/matrix
Then Apply _diff to that dimension

@param {Array} arr      The array
@param {number} dim     Dimension
@return {Array}         resulting array