143
rated 0 times
[
144]
[
1]
/ answers: 1 / hits: 28624
/ 14 Years ago, thu, january 6, 2011, 12:00:00
I am trying to do something like this:
var obj = {
a: 5,
b: this.a + 1
}
(instead of 5 there is a function which I don't want to execute twice that returns a number)
I can rewrite it to assign obj.b
later from obj.a
, but can I do it right away during declaration?
More From » javascript