function doSomething(name) {
console.log('Hello, ' + name);
}
function loggingDecorator(wrapped) {
return function () {
console.log('Starting');
console.log("arguments", arguments)
const result = wrapped.apply(this, arguments);
console.log('Finished');
return result;
}
}
var argu = 'top';
var wrapp = loggingDecorator(doSomething);
wrapp(argu);
网友评论