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