Skip to content

Instantly share code, notes, and snippets.

@rooklift
Created July 29, 2021 22:11
Show Gist options
  • Save rooklift/39791c487cdc7b8da931d89d7a4a058f to your computer and use it in GitHub Desktop.
Save rooklift/39791c487cdc7b8da931d89d7a4a058f to your computer and use it in GitHub Desktop.
"use strict";
const barker_props = {
bark() {
console.log(`Woof, I am ${this.name}`);
}
};
const meower_props = {
meow() {
console.log(`Meow, I am ${this.name}`);
}
};
let dogcat = Object.assign(
{name: "Pebbles"},
barker_props,
meower_props,
);
dogcat.bark();
dogcat.meow();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment