Medium
JavaScript Array Chaining: Understanding map, filter, and reduce with Initial Value
What will be the output of the following code, and why?
1let data = [2, 5, 8, 11];2let initial = 10;34let finalResult = data5 .map((num, index) => index % 2 === 0 ? num + initial : num - initial)6 .filter(num => num > 5)7 .reduce((acc, num) => acc + num, initial);89console.log(finalResult);