var myArray = []; for (var i = 1; i < 10; i += 2){ myArray.push(i); } console.log(myArray); // console output [ 1, 3, 5, 7, 9 ]