# Skip to next in for loop

**URL:** <https://forum.kirupa.com/t/skip-to-next-in-for-loop/307222>\
**Category:** Uncategorized\
**Created:** [March 30, 2010, 10:02pm UTC](https://forum.kirupa.com/t/skip-to-next-in-for-loop/307222 "2010-03-30T22:02:23Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![krazycat](https://avatars.discourse-cdn.com/v4/letter/k/b3f665/32.png) [@krazycat](https://forum.kirupa.com/u/krazycat)\
**Post date:** [March 30, 2010, 10:02pm UTC](https://forum.kirupa.com/t/skip-to-next-in-for-loop/307222/1 "2010-03-30T22:02:23Z")

</div>

Is there a way to skip to the next record in a for loop, without executing whats in the for loop? I hade an idea:

```auto
for (var i=0;i<testXml.product.length();i++) {
    if (testXml.product*.related != productToRelate) {
        next();
    };
    Execute some code
};

```

The “else” isn’t really working in the real code, so I really need a way to skip the record in some case.
