Skip to content

Commit a58f225

Browse files
committed
Use RangeError instead of simple Error
1 parent 8c6c485 commit a58f225

File tree

1 file changed

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

1 file changed

+2
-2
lines changed

09-behavioral-design-patterns/05-iterator-iterable-matrix/matrix.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,14 @@ export class Matrix {
55

66
get (row, column) {
77
if (row >= this.data.length || column >= this.data[row].length) {
8-
throw new Error('Out of bounds')
8+
throw new RangeError('Out of bounds')
99
}
1010
return this.data[row][column]
1111
}
1212

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

0 commit comments

Comments
 (0)