Try this instead:
var result = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16];
for (var i = 0; i < result.length; i++) result.splice(i, 6);
This will:
- First remove
[0, 1, 2, 3, 4, 5]
, and let[6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16]
be. - Next remove
[7, 8, 9, 10, 11, 12]
and let[13, 14, 15, 16]
be. - Finally remove
[13, 14, 15, 16]
.
Hence the result is [6, 13]
. Is this what you want?