operator [] method
- int index
Implementation
operator [](int index) {
if (index < 0) {
throw RangeError("index must be positive");
}
var i = 0;
for (var element in this) {
if (i == index) {
return element;
}
i++;
}
throw RangeError("index out of range");
}