Possible Duplicate:
Self-references in object literal declarations
Is there any way access the value of a property name in the same object literal? Something like this:
myFunction.init({
varOne: 'something',
varTwo: this.varOne + 'something else'
})
varTwoin the original question will always update whenvarOneis changed with the getter approach. That is different from what I would expect the behavior to be in the question (assuming it was even possible). If the code in the question actually worked I would expect it to initializevarTwowithvarOneonce and not changevarTwoifvarOneis changed in the future.