```javascript function processArray(arr, func) { return arr.reduce((accumulator, currentValue) => { accumulator.push(func(currentValue)); return accumulator; }, []); } let inputArray = [1, 2, 3]; let processingFunction = function(x) { return x * 2; }; console.log(processArray(inputArray, processingFunction)); ``` [2024-11-08 21:49:51 | AI写代码神器 | 90点数解答]