-3
The question is basically this: We need a product function that takes an array of numbers and returns the product: the result of multiplying all the elements among themselves.
For example, product([1, 4, 7]) should return 28, which is 1 * 4 * 7.
because you used "var res = 1", not "0" ?
– Vanessa Dutra Da Silva
It begins in 1 because 1 is the neutral term of multiplication, also called the neutral element or identity element. See more in https://pt.wikipedia.org/wiki/Elemento_neutro
– Woss
If starting with zero, the multiplication result will always be zero, regardless of the numbers in the array
– hkotsubo