File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 99
1010// code here
1111
12+ class User {
13+ constructor ( options ) {
14+ this . email = options . email ;
15+ this . password = options . password ;
16+ }
17+
18+ // method comparePasswords() for User class
19+ comparePasswords ( passwords ) {
20+ if ( this . password === passwords ) {
21+ return true ;
22+ }
23+ return false ;
24+ }
25+ }
26+
1227// Part 2
1328// Create a class called `Animal` and a class called `Cat` using ES6 classes.
1429// `Cat` should extend the `Animal` class.
2136
2237// code here
2338
39+ class Animal {
40+ constructor ( options ) {
41+ this . age = options . age ;
42+ }
43+
44+ // Animal method growOlder()
45+ growOlder ( ) {
46+ return this . age + 1 ;
47+ }
48+ }
49+
50+ class Cat extends Animal {
51+ constructor ( options ) {
52+ super ( options ) ;
53+ this . name = options . name ;
54+ }
55+
56+ meow ( ) {
57+ return `${ this . name } meowed!` ;
58+ }
59+ }
60+
2461/* eslint-disable no-undef */
2562
2663module . exports = {
You can’t perform that action at this time.
0 commit comments