Skip to content

Commit cc8c767

Browse files
authored
Add getArea method where it is necessary.
Without this, the `shape.getArea()` call below will cause an error.
1 parent bc1ae6a commit cc8c767

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
@@ -1203,6 +1203,10 @@ class Square extends Shape {
12031203
setLength(length) {
12041204
this.length = length;
12051205
}
1206+
1207+
getArea() {
1208+
return this.length * this.length;
1209+
}
12061210
}
12071211

12081212
function renderLargeShapes(shapes) {

0 commit comments

Comments
 (0)