```javascript function countCalls(func) { let callCount = 0; return function(...args) { callCount++; console.log(`called ${callCount} times`); func(...args); }; } function sayHello(name) { console.log('hello'+ name); } let decoratedSayHello = countCalls(sayHello); decoratedSayHello('John'); decoratedSayHello('Alice'); decoratedSayHello('Bob'); ``` [2024-11-08 21:48:00 | AI写代码神器 | 111点数解答]