Trying to make this function true. I think the problem is in my for loop.
function forEach(array, callback){
console.log(array, callback);
for(var i = 0; i < array.length; i++) {
}
}
// testing your code with console.assert
var total = 1;
var myArray = [1, 2, 3, 4];
function multiplyTotal(a) {
total *= a;
}
forEach(myArray, multiplyTotal);
// and finally assert; if this fails, the program stops
console.assert(total === 24);
callback? What did you expect to see happen? Addcallback(array[i]);in yourforloop. Or just use the existingforEachfunctions in Javascript.