function Index (ranges) {
    if (!(this instanceof Index)) {
      throw new SyntaxError('Constructor must be called with the new operator')
    }

    this._dimensions = []
    this._sourceSize = []
    this._isScalar = true

    for (let i = 0, ii = arguments.length; i < ii; i++) {
      const arg = arguments[i]
      const argIsArray = isArray(arg)
      const argIsMatrix = isMatrix(arg)
      const argType = typeof arg
      let sourceSize = null
      if (isRange(arg)) {
        this._dimensions.push(arg)
        this._isScalar = false
      } else if (argIsArray || argIsMatrix) {
        // create matrix
        let m

        if (getMatrixDataType(arg) === 'boolean') {
          if (argIsArray) m = _createImmutableMatrix(_booleansArrayToNumbersForIndex(arg).valueOf())
          if (argIsMatrix) m = _createImmutableMatrix(_booleansArrayToNumbersForIndex(arg._data).valueOf())
          sourceSize = arg.valueOf().length
        } else {
          m = _createImmutableMatrix(arg.valueOf())
        }

        this._dimensions.push(m)
        // size
        const size = m.size()
        // scalar
        if (size.length !== 1 || size[0] !== 1 || sourceSize !== null) {
          this._isScalar = false
        }
      } else if (argType === 'number') {
        this._dimensions.push(_createImmutableMatrix([arg]))
      } else if (argType === 'bigint') {
        this._dimensions.push(_createImmutableMatrix([Number(arg)]))
      } else if (argType === 'string') {
        // object property (arguments.count should be 1)
        this._dimensions.push(arg)
      } else {
        throw new TypeError('Dimension must be an Array, Matrix, number, bigint, string, or Range')
      }
      this._sourceSize.push(sourceSize)
      // TODO: implement support for wildcard '*'
    }
  }
Create an index. An Index can store ranges and sets for multiple dimensions.
Matrix.get, Matrix.set, and math.subset accept an Index as input.

Usage:
    const index = new Index(range1, range2, matrix1, array1, ...)

Where each parameter can be any of:
    A number
    A string (containing a name of an object property)
    An instance of Range
    An Array with the Set values
    An Array with Booleans
    A Matrix with the Set values
    A Matrix with Booleans

The parameters start, end, and step must be integer numbers.

@class Index
@Constructor Index
@param {...*} ranges