- break
Break out from while loop in JavaScript
examples/js/break_while.js
"use strict"; var n = 1; while (n < 7) { n++; console.log(n); if (n >= 4) { break; } }
2 3 4
"use strict"; var n = 1; while (n < 7) { n++; console.log(n); if (n >= 4) { break; } }
2 3 4