Skip to content

Commit 00afbad

Browse files
Current progress
1 parent de6985d commit 00afbad

8 files changed

Lines changed: 252 additions & 29 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.swo‎

12 KB
Binary file not shown.

‎src/.prototype.js.swo‎

12 KB
Binary file not shown.

‎src/class.js‎

Lines changed: 29 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
/* eslint-disable */
12
// Part 1
23
// Create a class called User using the ES6 class keyword.
34
// The constructor of the class should have a parameter called `options`.
@@ -7,8 +8,16 @@
78
// for a potential password that will be compared to the `password` property.
89
// Return true if the potential password matches the `password` property. Otherwise return false.
910

10-
// code here
11+
class User {
12+
constructor(options) {
13+
this.email = options.email;
14+
this.password = options.password;
15+
}
16+
comparePasswords(potentialPassword) {
17+
return this.password === potentialPassword;
18+
}
1119

20+
}
1221
// Part 2
1322
// Create a class called `Animal` and a class called `Cat` using ES6 classes.
1423
// `Cat` should extend the `Animal` class.
@@ -19,7 +28,25 @@
1928
// `meow` that should return the string `<name> meowed!` where `<name>` is the `name`
2029
// property set on the Cat instance.
2130

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

2451
/* eslint-disable no-undef */
2552

0 commit comments

Comments
 (0)