function addToArr(num, arr) {
arr.push(num);
}
theArr = [1, 2, 3, 4];
myArr = [];
theArr.forEach(addToArr(ele, theArr));
console.log(myArr);
I wanted to write a function that could be used in a forEach() that could take a different array as a parameter - that I could push to.