jscript array passing to functions 2004-07-06 - By kim aldis
Back That's just what I needed. Thank's Olivier.
> -- --Original Message-- -- > From: owner-xsi@(protected) > [mailto:owner-xsi@(protected)] On Behalf Of OO's mailbot > Sent: 05 July 2004 22:05 > To: XSI@(protected) > Subject: Re: jscript array passing to functions > > JScript passes array and objects by reference, so you can > change their contents, but you can't clobber the variable and > pass that change back. > for example: > > var myArray = new Array(0,1,2); > LogMessage(myArray); > > ChangeValues(myArray); > LogMessage(MyArray); > > ClobberIt(myArray); > LogMessage(myArray); > > function ChangeValue(someArray) > { > someArray[0] = 'Zero'; > someArray[1] = 'One'; > someArray[2] = 'Two'; > } > > function ClobberIt(someArray) > { > someArray = new Array('A', 'B', 'C'); > } > > > > > > On Jul 6, 2004, at 2:05 AM, kim aldis wrote: > > > By value or by reference? (too lazy to look it up) > > --- > Unsubscribe? Mail Majordomo@(protected) with the following > text in body: > unsubscribe xsi > > >
--- Unsubscribe? Mail Majordomo@(protected) with the following text in body: unsubscribe xsi
|
|