include::../description.adoc[]

== Noncompliant Code Example

----
function doSomething()
{
  var i;
  for (i = 0; i < 10; i++)
  {
    i = 11; // Noncompliant
  }
}
----

== Compliant Solution

----
function doSomething()
{
  var i, done;

  for (i = 0; i < 10; i++)
  {
    alert("i = " + i);
  }

  done = false;
  for (i = 0; i < 10 && !done; i++)
  {
    if (i == 5)
    {
      alert("i equals 5");
      done = true;
    }
  }
}
----

ifdef::env-github,rspecator-view[]
'''
== Comments And Links
(visible only on this page)

include::../comments-and-links.adoc[]
endif::env-github,rspecator-view[]
