HackerRank Problem Link
JS Solution
function Polygon(shape) { this.type = shape; this.perimeter = getPerimeter; } function getPerimeter() { return this.type.reduce((a, b) => a + b); }
Last updated 3 years ago
Was this helpful?