Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

JavaScript

Why is my throw statement not working?

Here is my workspace:

https://w.trhou.se/1f3mkxwj9b

While my code overall is running fine, I see an error in the console for my throw statement. What am I doing wrong?

2 Answers

Is that the error the throw method throws? :laughing:

Your code is working fine. Remember that throw literally makes an error. You should be seeing an error if the line of code is executed.

I hope this helps :grin:

Happy coding! :tada:

:dizzy: ~Alex :dizzy:

throw is error statement.

Make an error in your code and it will throw.