Difficulty: 6/10callbacks, function composition, async utilitiesAll examples of map,reduce, filter, currying and functions with callbacks are examples of HOC.javascriptCopyScenario Questions0-2 years experience1We have an array of numbers and need to double each value. Write a function that takes a callback to apply the transformation. How would you implement it using a higher‑order function?2Suppose you need to filter a list of users based on a predicate you’ll receive at runtime. Show how you'd write a higher‑order function that returns the filtered list.2-5 years experience1Your team added a utility `mapAsync` that takes an array and an async callback, but it's causing unhandled promise rejections in production. Walk me through how you'd debug it and what changes you'd make.Follow-up QuestionsWhat happens if the callback throws an error?How would you preserve the `this` context inside the higher‑order function?Can you compare the memory impact of chaining versus composing functions?Suggest Improvement