function inherit(Child,Parent){
Child.prototype = Object.create(Parent.prototype);
Child.prototype.constructor = Child;
}
function Shape(color){
this.color = color;
}
Shape.prototype.duplicate = function() {console.log(Duplicate Color: ${this}
)}; //refers to the correct object i.e Circle. How did this binding happen and why is that not applicable for ()=> shown below.?
function Circle(radius,color){
Shape.call(this,color);
this.radius = radius;
}
inherit(Circle,Shape);
Circle.prototype.draw = () => {console.log(Draw!! Radius:-${this}
)}; //this here refers to global object!
let c = new Circle(1,‘Blue’);