Quantcast
Channel: SCN: Message List
Viewing all articles
Browse latest Browse all 2695

Break in a foreach

$
0
0

Hello community,

 

I have an issue and i found nothing on the internet or SCN to help me, so here i am.

 

Is it possible to have a break in a foreach ?

In my case, i want to check if a Dimension in List1 is available in List2.

 

So i have this code to check :

 

listArea2.forEach(function(element1, index1) {

  listArea1.forEach(function(element2, index2) {

    if (element1.internalKey == element2.internalKey)

    {

             BREAK IT !

    }

  });

});

 

So when my condition is check, i want to move to next dimension, and break the 2nd loop but i didn't find how...

 

Thank for your precious help !


Viewing all articles
Browse latest Browse all 2695

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>