Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class Rat {
- constructor(name) {
- this.name = name;
- this.rats = [];
- }
- getRats() {
- return this.rats;
- }
- unite(otherRat) {
- return otherRat.constructor.name === this.constructor.name && this.rats.push(otherRat);
- }
- toString() {
- return this.name;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement