Question 10
Consider the below javascript program.
const numbers = [10, 20, 30];const modifiedNumbers = numbers.reduce((acc, num) => { if (num % 2 === 0) { acc.push(num * 2); } else { acc.push(num / 2); } return acc;}, []);
const finalOutput = modifiedNumbers.filter(num => num > 20);console.log(finalOutput);What will be the output of the above program?
[]
[10, 20, 30]
[20, 40, 60]
[40, 60]
[40]