I think you are trying to return the product of the elements of an array.
but if you execute above code you will get sum of elements of that array. remove the last “return product” statement which is not initialised and outside the function
mistakes I found:
you are using + instead of * .
In the base condition you are returning 0 , so you will get 0 as the answer .