# 'Javascript Loop 3 - Test your skills' problem

**URL:** <https://discourse.mozilla.org/t/javascript-loop-3-test-your-skills-problem/68824>\
**Category:** Learn\
**Tags:** learning\
**Created:** [October 8, 2020, 8:21pm UTC](https://discourse.mozilla.org/t/javascript-loop-3-test-your-skills-problem/68824 "2020-10-08T20:21:33Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![bolszi1](https://avatars.discourse-cdn.com/v4/letter/b/d2c977/32.png) [@bolszi1](https://discourse.mozilla.org/u/bolszi1)\
**Post date:** [October 8, 2020, 8:21pm UTC](https://discourse.mozilla.org/t/javascript-loop-3-test-your-skills-problem/68824/1 "2020-10-08T20:21:33Z")

</div>

Hi, I’m trying to do the 3rd Loop exercise from ‘test your skills’ section but I cannot find a bug in my code. I checked other posts here but it didn’t help to find it.

Thank you in advance.

My code:

let para = document.createElement(‘p’);  
let i = 500;

```
function isPrime(num) {
  for(let i = 2; i < num; i++) {
    if(num % i === 0) {
      return false;
    }
  }

  return true;
}
do{
  if(isPrime(i)===true){
    para.textContent += i + ", ";
  }
  else{continue;
      }
  i--;
}
while(i>1);

let section = document.querySelector('section');
section.appendChild(para);
```

---

<div class="post-metadata">

**Author:** ![justsomeone](https://sea1.discourse-cdn.com/flex001/user_avatar/discourse.mozilla.org/justsomeone/32/67787_2.png) [@justsomeone](https://discourse.mozilla.org/u/justsomeone)\
**Post date:** [October 9, 2020, 6:24am UTC](https://discourse.mozilla.org/t/javascript-loop-3-test-your-skills-problem/68824/2 "2020-10-09T06:24:17Z")

</div>

> [@bolszi1](#):
>
> ```auto
> else{continue;
> }
> 
> ```

that’s the issue  
cause in this code you go to the start of the do while without change the i value  
just remove it and it will work fine

hope that help and have a nice day
