P
pistacchio
hi to all!
having a problem with javascript, i've stripped the script down to a
few lines in order to post it here asking for help.
<code>
var objs = new Array();
obj = {
parameter : ''
}
objs[0] = obj;
objs[0].parameter = "apple";
objs[1] = obj;
objs[1].parameter = "banana";
alert(objs[0].parameter);
</code>
i insert the json object obj into the array and change the parameter.
now, i expect the alert to return "apple", while i keep getting
"banana", as, in some unpredictable way, the value has been
overlapped.
any help?
tia - gustavo
having a problem with javascript, i've stripped the script down to a
few lines in order to post it here asking for help.
<code>
var objs = new Array();
obj = {
parameter : ''
}
objs[0] = obj;
objs[0].parameter = "apple";
objs[1] = obj;
objs[1].parameter = "banana";
alert(objs[0].parameter);
</code>
i insert the json object obj into the array and change the parameter.
now, i expect the alert to return "apple", while i keep getting
"banana", as, in some unpredictable way, the value has been
overlapped.
any help?
tia - gustavo