Could we not initialize a Javascript object's property with value of another property of the same object?
I tried as in the code below and seems the initialization stays undefined:
"use strict"
let obj = {
name1 : 'Me',
name2 : this.name1,
func1(){
return name2;
},
};
console.log(obj.name2); //=> undefined
console.log(obj.func1()); //=> ReferenceError: name2 is not defined