About Web Hub

Web Development Learners Hub


Super friendly <br/>code & developer communities

Super friendly
code & developer communities

A place for coders and developers to share, learn and grow together.

Back to Hub

Can we break angular.forEach loop? If yes, How? If no, why?

3      Reply

you can't break angular.forEach loop

Reply

but why we can't break angular.forEach. any specific reason? Or any workaround? 

 in normal for loop if you return something then control come outside that loop but in forEach loop if you return something still loop will continue..

check this site: medium.com/front-end-weekly/3-things-you-didnt-know-about-the-foreach-loop-in-js-ff02cec465b1