Question: Write a function called reduceFunctions with the following type: reduceFunctions(fa: ((p: Pixel) => Pixel)[] ): ((x: Pixel) => Pixel) That is, reduceFunctions takes an array
Write a function called reduceFunctions with the following type: reduceFunctions(fa: ((p: Pixel) => Pixel)[] ): ((x: Pixel) => Pixel) That is, reduceFunctions takes an array of functions, each taking a pixel and returning a pixel. It returns a single function (also from pixel to pixel) that composes all functions in the array, applied in order, left to right. Use reduce() to implement it.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
