Skip to content

Commit bdd7370

Browse files
committed
done
1 parent de6985d commit bdd7370

6 files changed

Lines changed: 270 additions & 19 deletions

File tree

package-lock.json

Lines changed: 148 additions & 17 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
"repository": {
1313
"type": "git",
1414
"url": "git+https://github.com/LambdaSchool/javascript-ii.git"
15-
},
15+
},
1616
"devDependencies": {
1717
"babel-jest": "^19.0.0",
1818
"eslint": "^3.17.1",

src/class.js

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,16 @@
88
// Return true if the potential password matches the `password` property. Otherwise return false.
99

1010
// code here
11+
class User {
12+
constructor(options) {
13+
this.email = options.email;
14+
this.password = options.password;
15+
}
16+
comparePasswords(potentialPassword) {
17+
if (potentialPassword === this.password) return true;
18+
return false;
19+
}
20+
}
1121

1222
// Part 2
1323
// Create a class called `Animal` and a class called `Cat` using ES6 classes.
@@ -20,6 +30,24 @@
2030
// property set on the Cat instance.
2131

2232
// code here
33+
class Animal {
34+
constructor(options) {
35+
this.age = options.age;
36+
}
37+
growOlder() {
38+
return ++this.age;
39+
}
40+
}
41+
42+
class Cat extends Animal {
43+
constructor(options) {
44+
super(options);
45+
this.name = options.name;
46+
}
47+
meow() {
48+
return `${this.name} meowed!`;
49+
}
50+
}
2351

2452
/* eslint-disable no-undef */
2553

0 commit comments

Comments
 (0)