1 Example with 2 completely different code snippets
3 <h2>Noncompliant Code Example</h2>
4 <pre class="diff-id-1 diff-noncompliant">
5 while (true) { // Noncompliant; constant end condition
11 while (b) { // Noncompliant; constant end condition
15 <h2>Compliant Solution</h2>
16 <pre class="diff-id-1 diff-compliant">while (true) { // break will potentially allow leaving the loop
18 for(let i=2; i<4; i++) {
19 console.log("Hello there");