Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 03bcebd

Browse files
Merge pull request ryanmcdermott#8 from alaycock/patch-1
Add getArea method where it is necessary.
2 parents 667ff35 + b49c571 commit 03bcebd

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

README.md

Lines changed: 5 additions & 1 deletion
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) {
@@ -1220,7 +1224,7 @@ function renderLargeShapes(shapes) {
12201224
}
12211225

12221226
let shapes = [new Rectangle(), new Rectangle(), new Square()];
1223-
renderLargeShapes();
1227+
renderLargeShapes(shapes);
12241228
```
12251229
**[⬆ back to top](#table-of-contents)**
12261230

0 commit comments

Comments
 (0)