Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

10
  • 14
    For example, it may assume that the .message property of the Error is a string, try to call a string method on it, and explode. Commented Feb 14, 2015 at 19:08
  • 8
    You can, but I wouldn't say it's "okay". Commented Oct 22, 2016 at 2:10
  • 9
    This is an awful idea since it means you will have a much harder time debugging the bug without a stack trace. Commented Oct 19, 2017 at 13:37
  • 4
    @BenjaminGruenbaum If you throw a string in Chrome, you do get a stack trace. E.g ` function a() { throw "Hello World"; } a();` will have a stacktrace like this: a @ main.js:4 (anonymous) @ main.js:7 Commented Oct 26, 2017 at 18:05
  • 1
    @Taurus thanks, I didn't know that - now try doing it with the debugger not connected on in firefox :) Commented Oct 26, 2017 at 18:40