I am needing to find the correct way to have javascript loop through an array, find all numbers that are divisible by 3, and push those numbers into a new array.
Here is
var originalArray = [1, 2, 3, 4, 5, 6, 7, 8, 9]; function loveTheThrees(array1) { var threes = []; for (var i = 0; i < array1.length; i++) { if (array1[i] % 3 === 0) { threes.push(array1[i]); } } return threes; } loveTheThrees(originalArray);