Skip to content

Instantly share code, notes, and snippets.

@preaction
Forked from DLSteve/inc10.js
Last active January 5, 2018 22:57
Show Gist options
  • Save preaction/e149f44eb8caa1820c8f57e90def07c0 to your computer and use it in GitHub Desktop.
Save preaction/e149f44eb8caa1820c8f57e90def07c0 to your computer and use it in GitHub Desktop.
Increment Every 10
var nodes = [ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13 ];
for (var i = 0; i < nodes.length; i+=10) {
for ( var j = 0; j < 10 && i+j < nodes.length; j++ ) {
console.log( 'i:' + i + ' j:' + j + ' i+j:' + ( i + j ) );
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment