What is the best practice for assigning a value to a key using a method that is in the parent object?
I have tried several variations of the following:
const data = {
one : {
a : {
hours : 100,
minutes : getMinutes()
},
b : {
hours : 24,
minutes : getMinutes()
}
},
getMinutes : function() {
return this.hours * 60
}
}