Possible Duplicate:
Accessing a JavaScript Object Literal's Value within the Same Object
Let's take a closer look at this JavaScript object
var settings = {
user:"someuser",
password:"password",
country:"Country",
birthplace:country
}
I am trying to set the value of birthplace
to be the same as country
, so I placed the object value of country
in front of birthplace
, but it did not work. I also tried using this.country
but that also failed. My question is, how can I access a property of an object within the same object.
For those who may wonder what my goal is or request more information, all I want to achieve is accessing an object property within the same object, and the script is provided above.
Any assistance would be greatly appreciated :)
Thank you