I have a class like this:
class X extends Y {
public save() {
}
}
abstract class Y {
public saving() {
}
}
const x = new X;
x.save();
How can I make sure each call to save
triggers saving
before?
In PHP, we can use __call
and check the method name. Is there any similar approach with Javascript?