Let's see an example where a child class object invokes the parent class method.
A is invoked
Let's see an example where a child and parent class contains the same method. Here, the object of child class invokes both classes method.
A is invoked B is invoked
Let's see the same example with prototype-based approach.