function productArray(numbers){ //your code here let ans=[]; let temp; for(let i=0;i<numbers.length;i++){ temp=numbers; temp.splice(i,1); ans.push(numbers.reduce((prev,cur)=>prev*cur)); } return ans; } alert(productArray([1,2,3,4,5]))