Description
While I was doing the exercise myself (which is made to test users about the Arrow functions
and Callbacks
concepts), I came across something that I found a bit confusing: task 3 of this exercise requires users to
[...] throw a new error if
err
is not null.
This implies using the javascript throw statement as part of the function the exercise asks you to build. However, the Errors
concept (where the throw
statement is developed) is to be found much further down the syllabus tree, and the way the instruction is described in the task might make users think that "throwing an error" just means returning a string with an message with an error text as opposed to using the error
statement. This is what I did myself, which meant that when running the tests, I got a message from the debugger saying that I was supposed to use something I didn't even know existed to complete the exercise.
I believe this can be easily fixed by either:
- Making sure the instruction of the task is clear about what the user needs to use (the
error
statement). An easy fix to this would be to add a link to its MDN page in the very same paragraph. - Removing the need to use such statement. This would imply modifying the exercise so that users are required to simply return a string with an error message instead.