Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save robertknight/8f3f6f87fdeb4129a6a9 to your computer and use it in GitHub Desktop.
Save robertknight/8f3f6f87fdeb4129a6a9 to your computer and use it in GitHub Desktop.
var ary = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15];
for each (let v in ary) {
console.log('v is', typeof v, ary.indexOf(v));
ary.splice(ary.indexOf(v), 1);
}
var ary2 = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15];
for (var n in ary2) {
var v = ary2[n];
console.log('n is', n, 'v is', typeof v, ary2.indexOf(v));
ary2.splice(ary2.indexOf(v), 1);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment