150
rated 0 times
[
152]
[
2]
/ answers: 1 / hits: 29208
/ 9 Years ago, mon, june 8, 2015, 12:00:00
Is it possible for me to access every other item in an array? So basically, all items in positions 0, 2, 4, 6 etc.
Here's my code if it helps:
function pushToHash(key, value) {
for (var t = 0; t < value.length; t++) {
MQHash[key[t]] = value.slice(0, lineLength[t]);
}
}
So, I need to get every other value of lineLength
. I only want this for lineLength
, not key
. I was thinking of doing a modulus, but wasn't sure how I'd implement it. Any ideas?
Thanks in advance!
More From » arrays