Question Pedro in lesson «The iterative process and how to not be lazy», course «Programming fundamentals»

Pedro

I'm sorry, but I don't understand what is wrong with my code:

  const iter = () => {
    // removed
}
2 0

Pedro

Then I tried to use your solution, and it still doesn't work. I literally copied it

0

Olga

Pedro,

you did a great job. Your solution is correct. It just needs to be improved a little bit.

Once the solution is run we’ve got the error message on the “Output” screen: “RangeError: Maximum call stack size exceeded”. The means that for some of the test cases there is no terminal case, i.e. function is running and never stops (until the max size of call stack exceeded).

On the left sidebar of the exercise screen, you can find smallestDivisor.test.js file which contains all of the test cases for this exercise. Try to comment out all of the tests and then run them one by one so that you can find which test is failing and get a hint on how to improve your code to pass all of the tests successfully.

Hope this helps, and let us know if you need any further assistance.

NB: Your solution was removed so as not to confuse other students. Please use the “code review” feature to save your solution on the site (or even save multiple versions of your solution for your further reference). Later you can share it with others and use it for further discussion.

0

Use Hexlet to the fullest extent!

  • Ask questions about the lesson
  • Test your knowledge in quizzes
  • Practice in your browser
  • Track your progress

Sign up or sign in

By sending this form, you agree to our Personal Policy and Service Conditions
Suggested learning programs

From a novice to a developer. Get a job or your money back!

Frontend Developer icon
Profession
beginner
Development of front-end components for web applications
start anytime 10 months
Layout Designer icon
Profession
New Under development beginner
Layout with the latest CSS standards
start anytime 5 months