Skip to content
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"