Skip to content

Commit 0856eb8

Browse files
alaycockfrappacchio
authored andcommitted
Add getArea method where it is necessary.
Without this, the `shape.getArea()` call below will cause an error.
1 parent 931c848 commit 0856eb8

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1202,6 +1202,10 @@ class Square extends Shape {
12021202
setLength(length) {
12031203
this.length = length;
12041204
}
1205+
1206+
getArea() {
1207+
return this.length * this.length;
1208+
}
12051209
}
12061210

12071211
function renderLargeShapes(shapes) {

0 commit comments

Comments
 (0)