Skip to content

Instantly share code, notes, and snippets.

@tengla
Created August 8, 2023 10:42
Show Gist options
  • Select an option

  • Save tengla/f52c860859cf076bf262220d96925828 to your computer and use it in GitHub Desktop.

Select an option

Save tengla/f52c860859cf076bf262220d96925828 to your computer and use it in GitHub Desktop.
const target = {
warn(...args){
console.log('tick')
console.log(this);
console.log(...args)
}
};
const logger = new Proxy(target, {
get (target, prop) {
return target.warn
}
});
logger.warn("Test");
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment