Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save jamesxv7/26184b41e07c57816f2185ced14e11f8 to your computer and use it in GitHub Desktop.
Save jamesxv7/26184b41e07c57816f2185ced14e11f8 to your computer and use it in GitHub Desktop.
Nice use of variables in a for loop.js
function someFunc(array) {
// some code...
// some code...
const length = array.length;
for (let index = 0; index < length; index++) {
const item = array[index];
// some
}
return 'some result';
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment