Gets the element at the specified index of the current array.
(index)
| 51 | |
| 52 | /** Gets the element at the specified index of the current array. */ |
| 53 | get(index) { |
| 54 | if (index < 0 || index >= this.length) { |
| 55 | console.raise(`cannot get element at index ${index}: array length is ${this.length}`); |
| 56 | } |
| 57 | return this.elements.get(index); |
| 58 | } |
| 59 | |
| 60 | /** Sets the element at the specified index of the current array. */ |
| 61 | set(index, value) { |