Currently diving into Javascript. Encountering an issue when attempting to utilize setters in prototyping.
Error Message: TypeError: cir1.radiusToCircle is not a function
var Circle = function(radius){
this._radius = radius;
}
//prototype
Circle.prototype ={
set radiusToCircle(rad) { this._radius = rad; },
get radiusFromCircle() { return this._radius;},
get area() { return (Math.PI * (this._radius * this._radius));}
};
var cir1 = new Circle(5);
cir1.radiusToCircle(14);
In search of the missing link here...
Appreciate any guidance provided.