const counter =0 function logCount() { console.log(counter.num) } function count() { counter.num++ } let activeEffect; function wrapper(fn){ const wrapped=function(...args){ activeEffect=fn fn(...args) } return wrapped } activeEffect = logCount const wrapperLog=wrapper(logCount) count() wrapperLog()