Question: Please execute the program below and explain why such results are created. class Parent { show() { document.writeln(Parent class invoked + ); }
Please execute the program below and explain why such results are created.
class Parent {
show() {
document.writeln("Parent class invoked " + " "); } }
class Child extends Parent {
show() {
document.writeln("Child class invoked " + " "); } }
var p=[new Parent(), new Child()]; //array of classes
p.forEach(function(message) {
message.show(); });
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
