Skip to content
Advertisement

Why exercism.org doesn’t accept my solution JS?

I just started with exercism and doing Javascript exercise 2, Lucian’s Luscious Lasagna.

I wrote all the code on my VSCode and it all worked fine. but when I insert it in the editor on exercise, it shows errors and doesn’t accept it. It is also showing some things I haven’t seen like ‘export’ before ‘const’ and ‘throw new Error’ inside the function. I’m really not sure how this works. How can I do it in a way that exercism editor would accept?

JavaScript

Advertisement

Answer

Your answer is correct, but as you wrote it in vs code and testing in exercism, it is not going to work, because you haven’t exported anything. To test, you have to export your variables and function

This should work:

JavaScript
User contributions licensed under: CC BY-SA
7 People found this is helpful
Advertisement