I would like to initialize property of object using another property of the same object which is just created using object literal:
var result = {
a : 1,
b : a
};
The result should be
{
a:1,
b:1
}
Is there any way to do this without first creating object? Using some kind of this?