I want to be able to proxy all methods of a class inside the constructor of a class itself.
class Boy {
constructor() {
// proxy logic, do something before each call of all methods inside class
// like if arg passed is 3, print something additionally
}
run(meters) {
console.log(meters)
}
walk(meters) {
// walk
}
}
const myBoy = new Boy();
console.log(myBoy.run(3)) // should print 3 and something else
I think a for loop for each method would be an interesting approach, but at that point I could just implement the logic in the first lines of each function.