LeetCodeSign of the Product of an ArraySign of the Product of an ArrayEasyArrayMathSolution export function arraySign(nums: number[]): number { const sign = (num: number) => { return num === 0 ? 0 : Math.sign(num); }; return sign(nums.reduce((prev, curr) => prev * sign(curr), 1)); }LeetCodeSign of the Product of an Arrayhttps://leetcode.com/problems/sign-of-the-product-of-an-array