operator [] method

dynamic operator [] (
  1. int index
)

Implementation

dynamic operator [](int index) {
  switch (index) {
    case 0:
      return item0;
    case 1:
      return item1;
    case 2:
      return item2;
  }
  throw RangeError.index(index, this, 'index', 'index out of range', 3);
}