Skip to content

Commit 668092b

Browse files
committed
Completed problem 1 in classes.js
1 parent ca5f52c commit 668092b

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

‎classes.js‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,15 @@
22

33
// problem #1
44
// convert the Animal constructor function from 'constructors.js' into an ES6 class
5+
class Animal {
6+
constructor(options) {
7+
this.name = options.name;
8+
}
59

10+
grow() {
11+
console.log(`${this.name} grew larger!`);
12+
}
13+
}
614

715
// problem #2
816
// convert the Cat constructor function from 'constructors.js' into an ES6 class

0 commit comments

Comments
 (0)