I have an object where I save data to build a view and I want to know if there is any way to access other properties of that object from another property in the same object
I tried this
but it does not work
var obj = {
template: '
Nombre | Edad <br>
${this.names.name1} | ${this.age.age1}<br>
${this.names.name2} | ${this.age.age2}<br>
${this.names.name3} | ${this.age.age3}<br>
',
names: {
name1: 'Emmett',
name2: 'Paola',
name3: 'Mushi'
},
age: {
age1: 8,
age2: 20,
age3: 3
}
}
document.write(obj.template);