• + 0 comments
    class Polygon {
            constructor(_sides) {
                this.sides = _sides;
            }
            perimeter(){
                var perimeter = 0;
                this.sides.forEach(side => perimeter += side);
                return perimeter;
            }
        }