I'd like to set one value in an object to another, like so:
var obj = { value1: 'test' value2: value1 } Of course that doesn't work.
I feel like there would be an easier way than extending the object. Am I right?
Try,
var obj = { value1: 'test' }; obj.value2 = obj.value1; obj would contain a key called value2