Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Complete OOP Exercise #524

Merged
merged 4 commits into from
Sep 27, 2022
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Rename functions & args
  • Loading branch information
deveLabR committed Sep 23, 2022
commit ef21d0ed3c717453b3fbb0aa4e4901a896cb6b97
8 changes: 4 additions & 4 deletions submissions/develabr/oop/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ class Creature {
this.friends = friends;
this.args = ['species', 'name', 'gender', 'saying', 'friends'];
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Inhabitants are characterized rather by properties or features. No one says 'Name is my argorGender is my arg`

}
tellMeAboutYou() {
personInfoItems() {
return this.args.map((key) => this[key]).join('; ');
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

key is a generic, technical term.

}
}
Expand Down Expand Up @@ -59,8 +59,8 @@ class Catwoman extends Human {
}
}

const cat = new Cat('Kitty', 'female', "cats don't needs any friends");
const catWoman = new Catwoman('Catwoman', cat.saying, cat.name);
const cat = new Cat('Kitty', 'female', ["cats don't needs any friends"]);
const catWoman = new Catwoman('Catwoman', cat.saying, [cat.name]);
const woman = new Woman('Selina Kyle', 'Hello, Batman. Do you know Catwoman?', [
cat.name,
catWoman.name,
Expand All @@ -73,4 +73,4 @@ const dog = new Dog('Spike', 'male', [woman.name, man.name]);

const persons = [dog, cat, man, woman, catWoman];

persons.map((item) => print(item.tellMeAboutYou()));
persons.map((person) => print(person.personInfoItems()));