Задача Unit от Classes and Members
Моля за малко помощ, че ми омръзна да се боря с Judge.Не минават последните два теста.
class Rat {
    constructor(name) {
        this.name = name
        this.Rats = []
    }
    unit(obj) {
        if (obj.constructor.name == 'Rat') {
            this.Rats.push(obj)
        }
    }
    getRats() {
        return this.Rats
    }
    toString(){
        let names = this.name
        for (let rat of this.Rats){
           names+=`\n##${rat.name}`
        }
        return names
    }
}
         Благодаря ти много. Бях се отказал да го търся повече.
  Благодаря ти много. Бях се отказал да го търся повече.