This is a very basic question, and for some reason I am having a hard time wrapping my brain around it. I am new and learning so bear with me please. 

Here is a progress bar: <https://codepen.io/cmpackagingllc/pen/ZNExoa>

When the bar has loaded completely it adds the class completed as seen on js line 41.

```
progress.bar.classList.add('completed'); 

```

So say once completed I want to add an Alert that say's "completed". I assume this would be an easy task but because of the way the code is written with the loop seen on line 46/47

```
  loop();
}, randomInterval);

```

I am unable to incorporate the Alert properly without an alert loop even when I used return false to stop the loop afterwards. 

So the route I am trying to take now is to add the alert prompt to the success function found on line 21-25

```
function success() {
  progress.width = progress.bar.offsetWidth;
  progress.bar.classList.add('completed');
  clearInterval(setInt);
  alert("Completed!");
}

```

But now I am stuck trying to format it correctly so when the if is called on line 36 

```
if (progress.width >= progress.bar.offsetWidth) {

```

When the if is called on line 36 I want to to jump to the success function instead. No matter how I try it the code fails to execute. How would I format this correctly so it jumps to my function instead of looping after completed?

I would greatly appreciate some assistance with this. I am trying to understand if there is a better way to add the alert. Thank you much.