const startGame = {
time : 0,
start : function(){
}
next : function(){
}
end : function(){
}
}
const anotherGame = { //want to inherit from startGame
startAnother : function(){} //want to inherit from startGame.start
}
Given an object like this, I would like to inherit from it and give it a new property. For example, anotherGame extends startGame and takes all other properties, but I want to write additional code in addition to the properties of start function of startGame except for anotherStart function. What should I do ?