The error may be generated when the page loads. If you don't see any errors try reloading the page. Why not just use new Error... ? The exception (err) is caught by the catch statement and a custom error message is displayed:
Please input a number between 5 and 10:
Standard ECMAScript 2015 (6th Edition, ECMA-262)The definition of 'throw statement' in that specification. Step 2: Enable SCRIPT_DEBUG You need to turn on script debugging. How to create a company culture that cares about information security? Can you answer please, it's crucial for my understanding :) –jayarjo Jul 9 '11 at 9:43 21 According to code.google.com/p/chromium/issues/detail?id=228909 subclass.prototype = new Error() is bad form.
Email Rob to receive a free estimate on your software project. You are supposed to use subclass.prototype = Object.create(superclass.prototype) instead. Error has known properties as discussed by Hemant. –grantwparks May 14 '13 at 15:32 related: Throwing strings instead of Errors –Bergi Jun 9 at 17:28 add a comment| 3 Define Mistakenly Identify the Error The error console will open.
Comments- Your Turn! My error needs to be an instanceof both Error and NotImplemented, and it also needs to produce a coherent backtrace in the console. If you're using a third party library and want to wrap an existing error with your own custom type, the other methods do not work properly. Finding the distance between two points in C++ Why won't a series converge if the limit of the sequence is 0?