Home › Forums › JavaScript › Returning every third odd number within a user specified range › Re: Returning every third odd number within a user specified range
April 9, 2013 at 1:55 am
#131089
Participant
I am going to expand on this so using an array will make it easier for me to work with when i get that far…
Here is my thought on using the splice idea, I think this one works just fine actually for my purpose:
var arr = [1,3,5,7,9,11,13,15,17,19,21,23,25];
for(var i = 0; i < arr.length; i++) {
arr.splice(i+1,2);
}
console.log(arr);