# "loop" linter-jshint errors

**URL:** <https://discourse.codecombat.com/t/loop-linter-jshint-errors/6274>\
**Category:** Uncategorized\
**Created:** [December 26, 2015, 11:42pm UTC](https://discourse.codecombat.com/t/loop-linter-jshint-errors/6274 "2015-12-26T23:42:03Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![FlashFMA](https://avatars.discourse-cdn.com/v4/letter/f/e47774/32.png) [@FlashFMA](https://discourse.codecombat.com/u/FlashFMA)\
**Post date:** [December 26, 2015, 11:42pm UTC](https://discourse.codecombat.com/t/loop-linter-jshint-errors/6274/1 "2015-12-26T23:42:03Z")

</div>

```python
loop 
{
    var enemy = this.findNearestEnemy();
    if (enemy) {
        this.attack(enemy);
    }
}

```

Linter-JSHint gave me those errors:  
W030 - Expected an assignment or function call and instead saw an [expression.at](http://expression.at) line 1 col 1  
W033 - Missing [semicolon.at](http://semicolon.at) line 1 col 5

I have lots of `loop` in my code from сodeсombat and each `loop` gives two errors.  
Please explain me why they occur and how to get rid of these errors.

---

<div class="post-metadata">

**Author:** ![ChronistGilver](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.codecombat.com/chronistgilver/32/3778_2.png) [@ChronistGilver](https://discourse.codecombat.com/u/ChronistGilver)\
**Post date:** [December 27, 2015, 9:42pm UTC](https://discourse.codecombat.com/t/loop-linter-jshint-errors/6274/2 "2015-12-27T21:42:25Z")

</div>

I think you need to move the first bracket on the same line as the loop, but I’m not sure. Either that, or CodeCombat has taken out the `loop` command.

---

<div class="post-metadata">

**Author:** ![FlashFMA](https://avatars.discourse-cdn.com/v4/letter/f/e47774/32.png) [@FlashFMA](https://discourse.codecombat.com/u/FlashFMA)\
**Post date:** [December 28, 2015, 12:13am UTC](https://discourse.codecombat.com/t/loop-linter-jshint-errors/6274/3 "2015-12-28T00:13:54Z")

</div>

> [@ChronistGilver](#):
>
> I think you need to move the first bracket on the same line as the loop

No.  
I searched for `loop` in the JavaScript and could not find it even exists in the JS.

---

<div class="post-metadata">

**Author:** ![UltCombo](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.codecombat.com/ultcombo/32/3822_2.png) [@UltCombo](https://discourse.codecombat.com/u/UltCombo)\
**Post date:** [December 28, 2015, 12:51am UTC](https://discourse.codecombat.com/t/loop-linter-jshint-errors/6274/4 "2015-12-28T00:51:55Z")

</div>

> [@FlashFMA](#):
>
> I searched for loop in the JavaScript and could not find it even exists in the JS.

Indeed, it does not exist in the real JavaScript programming language.

However, a (relatively) long time ago, CodeCombat added the `loop` construct to make syntax easier on beginners, so they could focus on the programming logic instead of the syntax intricacies.

More recently, CodeCombat decided to move from the non-standard `loop` construct to `while (true) {}` loops. This is being done progressively (courses already use while-true loops, not sure about the campaign’s state), so you may find some rough edges.
