1

I want to reference a property's value to another property, something like below.

var user = [
    {
       property : "some value",
       "name" : this.property 
    }    
];

console.log(user[0]);

The name property is coming as undefined. "name" is something custom i am giving to each property value to identify it.

ShankarGuru
  • 627
  • 1
  • 6
  • 17
  • 1
    can't do that because full object hasn't been created during compile time at the point you try to assign it so there is no `this.property` – charlietfl Sep 27 '15 at 15:35

0 Answers0