Problem assigning javascript object properties -
is there way assign object property pear below? (example doesn't work)
var fruitcolors = { apple: "green", pear: fruitcolors.apple}; i can achieve doing however, i'd like above if it's possible.
var fruitcolors = { apple: "green" }; fruitcolors.pear = fruitcolors.apple;
i don't think can - fruitcolors object doesn't exist @ time trying access it's property.
Comments
Post a Comment