Multiplying elements within an array

Can someone tell me why this solution is returning 1 instead of multiplying the elements together?

const multiplyAll = (arr) => {
  let arrResult = 1
  for (let i = 0; i < arr.length; i++) {
    arrResult *= arr[i]
  return arrResult

Hi @iangoodman,

In the code sample provided, arrResult is never modified after it is declared and initialized on the line 2.

Did you mean to modify the name in the variable declaration and return statement to match the variable name you are using in the loop, newArr?

yes sorry! I jsut changed arrResult to what it was supposed to be. This the code i mean to post originally

Your code is now working then, correct? If not, let me know what the new issue is.