This is a frequently asked question: throw an exception or return?
I suggest you see this: fooobar.com/questions/99956 / ...
If your method cannot do what its name says, throw.
MDN, , , throw RangeError("x should be a non-negative number");. JavaScript , , , Error , , .