Day 4: Classes
Problem Link
Solution
function Polygon(shape) {
this.type = shape;
this.perimeter = getPerimeter;
}
function getPerimeter() {
return this.type.reduce((a, b) => a + b);
}
Last updated
Was this helpful?
function Polygon(shape) {
this.type = shape;
this.perimeter = getPerimeter;
}
function getPerimeter() {
return this.type.reduce((a, b) => a + b);
}
Last updated
Was this helpful?