Possible Duplicate:
Self-references in object literal declarations
var obj = {
value: 10,
value2: value + 2
};
How can I do the above? (Assuming it's even possible)
I am using a lot of jQuery's $.extend
to add more properties that rely on the previous values being added; so that modifying a few values automatically correct the rest.