Assessment wanted for Loops 1-3 skill test #learning

These are assignments:

This solution:
1.Loops 1 - JSFiddle - Code Playground
2. Loops 2 - JSFiddle - Code Playground
3. Loops 3 - JSFiddle - Code Playground

Hi @Svitcher

Wow, already the next tests finished! Let’s get to work… :grin:

All three outputs are correct! Congratulations :medal_sports:

Two questions about “Loops 3”:

  • You are not testing the first number since you do i-- at the start of the loop. If i=499 (instead of 500) how could you change the code to also test the first number and output this prime?
  • Your output ends with 5,3,2, How could you prevent the trailing comma?

If you like to you can update your Loops 3 fiddle to solve these questions. :sunglasses:

Have a nice day!
Michael

Hello! Thank you very much for your attention :slightly_smiling_face:. I have updated the code. The new link is here:
https://jsfiddle.net/Svitcher/sz26uhja/30/

1 Like

Cool! Now everything is fine.
Nice idea with the slice at the end :+1:

Michael

Thank you very much! :smile:

Nataliia

1 Like