Skip to content

Commit 5a420e3

Browse files
committed
Use RangeError
1 parent 3884af9 commit 5a420e3

File tree

1 file changed

+2
-2
lines changed
  • 09-behavioral-design-patterns/09-iterator-matrix-generator

1 file changed

+2
-2
lines changed

09-behavioral-design-patterns/09-iterator-matrix-generator/matrix.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,15 @@ export class Matrix {
66
get (row, column) {
77
if (row >= this.data.length ||
88
column >= this.data[row].length) {
9-
throw new Error('Out of bounds')
9+
throw new RangeError('Out of bounds')
1010
}
1111
return this.data[row][column]
1212
}
1313

1414
set (row, column, value) {
1515
if (row >= this.data.length ||
1616
column >= this.data[row].length) {
17-
throw new Error('Out of bounds')
17+
throw new RangeError('Out of bounds')
1818
}
1919
this.data[row][column] = value
2020
}

0 commit comments

Comments
 (0)