node.js - how to Break a For loop which has if statement in Nodejs -


i have scenario if statement inside loop. want break loop inside if statement , how achieve it?

for(i=0;i<5;i++){    if(i==2){      break;    } } 

yes, got right.

see mdn: https://developer.mozilla.org/en-us/docs/web/javascript/reference/statements/break

and stackoverflow question breaking inside nested loops if need it: best way break nested loops in javascript?


Comments

Popular posts from this blog

sql - Time in datatime field -

javascript - How to split the success output from an Ajax post? -

java - sharing object across different classes -