Skip to content

Instantly share code, notes, and snippets.

@yurivictor
Created November 13, 2014 05:24
Show Gist options
  • Save yurivictor/66b2e34d23513603ce22 to your computer and use it in GitHub Desktop.
Save yurivictor/66b2e34d23513603ce22 to your computer and use it in GitHub Desktop.
loop invariant
var letters = ['a', 'b', 'c'];
var length = letters.length;
var i = 0;
/* This is loop invariant. IDK. */
while ( i < length ) {
console.log( letters[i] );
i++;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment