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

edits to oop #17

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
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
5 changes: 3 additions & 2 deletions oop.js
Original file line number Diff line number Diff line change
Expand Up @@ -180,12 +180,13 @@ const adminFunctionStore = Object.create(userFunctionStore);

function adminFactory(name, score) {
const admin = new userFactory(name, score);
Object.setPrototypeOf(admin, adminFunctionStore)
admin.type = 'Admin';
return admin;
}

/* Put code here for a method called sharePublicMessage*/
userFunctionStore.sharePublicMessage = () => console.log('Welcome users!');
adminFunctionStore.sharePublicMessage = () => console.log('Welcome users!');

const adminFromFactory = adminFactory("Eva", 5);

Expand Down Expand Up @@ -217,4 +218,4 @@ let robotFido = new Dog();
robotFido = Object.assign(robotFido, robotSkillsMixin);

// /********* Uncomment these lines to test your work! *********/
robotFido.speak() // -> Logs "I am made of metal"
robotFido.speak() // -> Logs "I have 4 legs and am made of metal"