function logDecorator(func) {
return function() {
console.log(`Function called: ${func.name}`);
return func.apply(this, arguments);
};
}
function add(a, b) {
return a + b;
}
const decoratedAdd = logDecorator(add);
console.log(decoratedAdd(2, 3));