var CreateTest = function CreateTest(name) {
this.name = name
this.roll = () => ['simple', 'hard'][Math.round(Math.random())]
}
CreateTest.prototype.renameObj = function () {
return {
rename: () => {
return this.name = `${this.roll()} ${this.name}`
}
}
}
var test = new CreateTest('js test')
console.log(test.renameObj().rename())
мои 5 копеек %)