• + 0 comments
    class Polygon {
        constructor(sides) {
            this.sides = sides;
        }
        
        perimeter() {
            return this.sides.reduce((acc, curr)=> acc+curr, 0);
        }
    }