diff --git a/curriculum/challenges/english/blocks/lecture-debugging-techniques/6733aa9b006d29f4d11307a5.md b/curriculum/challenges/english/blocks/lecture-debugging-techniques/6733aa9b006d29f4d11307a5.md index 113cd71c643..63e4363b840 100644 --- a/curriculum/challenges/english/blocks/lecture-debugging-techniques/6733aa9b006d29f4d11307a5.md +++ b/curriculum/challenges/english/blocks/lecture-debugging-techniques/6733aa9b006d29f4d11307a5.md @@ -50,14 +50,14 @@ This example will result in a `developerObj.map is not a function` error because The last common error we will look at is the `RangeError`. -A `RangeError` happens when your code tries to use a value that’s outside the range of what JavaScript can handle. Here is an example of trying to assign an invalid index to the length of the array: +A `RangeError` happens when your code tries to use a value that’s outside the range of what JavaScript can handle. Here is an example of assigning an invalid value to an array's length: ```js const arr = []; arr.length = -1; ``` -Since `-1` is not a valid index used for arrays, this will result in a `RangeError`. +Since an array's `length` has to be a non-negative integer, setting it to `-1` triggers a `RangeError`. As you continue to program in JavaScript, just be aware of these different types of errors you will probably encounter and why they are happening. @@ -137,7 +137,7 @@ The error happens because the variable is being treated like a function when it' ## --text-- -Which error occurs when you try to access an array index that doesn't exist? +Which error occurs when you assign an invalid value, such as `-1`, to an array's `length`? ## --answers--