Answer the question
In order to leave comments, you need to log in
Store a property in an object whose value depends on another property?
Hello! I'm just getting started with js. I have a task that has the following structure
function papa(e){
return{value:e
sum:function(b){
this.e+=b
return this}
}
}
I need to create another property whose value will be e. But however, when the sum method is called, the value of both properties must change. How to do it?
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question