Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class Bird {
- constructor(name) {
- this.type = 'bird';
- this.name = name;
- }
- printName() {
- console.log(this.name);
- }
- printType() {
- console.log(this.type);
- }
- }
- const b = new Bird('hi');
- b.printName();
- b.printType();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement