Q:

JavaScript - Call parent class function and replace it

I have a class for basic stuff and I use it to extends in another classes, what I want to do is exec some code in a function with the same name in my class and then exec the parent class function.
Here are an example:
class A {
  foo() {
    // Do something
  }
}

class B extends A {
  foo() {
    // Do something different from A
    // Now exec the parent foo()
  }
}

A:

you can use super:
class A {
  foo() {
    console.log('A')
  }
}

class B extends A {
  foo() {
    console.log('B')
    super.foo()
  }
}

