[thelist] pass by value in JavaScript?
Michiel Trimpe
M.B.Trimpe at student.tue.nl
Thu Apr 25 12:42:00 CDT 2002
Hi Matt,
It might feel ugly but it is the best way to go. Most programming
languages offer some sort of copyOf() method but I couldn't find it in
any reference so I don't suppose JS's Option object has one.
If referencing suffices then that would be the best though but I
assume that won't be possible.
GL,
Michiel Trimpe
Thursday, April 25, 2002, 6:37:58 PM, you wrote:
<snip>
PM> I'm working on something where I'm trying to copy Options from one Select to
PM> another.
</snip>
<snip>
PM> I can only guess that this is because the objects are being passed by
PM> reference, since the following DOES work, but feels ugly:
PM> form.select1.options[0] = new Option(form.select2.options[0].text,
PM> form.select2.options[0].value);
</snip>
More information about the thelist
mailing list