function getArrayProduct(numbers) { const numbersProduct = numbers.reduce((res, num) => res * num, 1); return numbers.map(num => numbersProduct / num); } console.log( getArrayProduct([1,5,2]).toString() === [10,2,5].toString() );// true