Task Calculate the product of all elements in an array. If the array is nil or is empty, the function should return nil. My solution def product(arr) if arr.nil? return nil else arr.inject(:*) end end Better solution def product(arr) arr&.reduce(:*) end