Topic awaiting preservation: Array related question |
|
---|---|
Author | Thread |
Nervous Wreck (II) Inmate From: Sweden, Malmoe |
posted 02-02-2003 16:12
Hello, |
Lunatic (VI) Mad Scientist From: Massachusetts, USA |
posted 02-02-2003 17:43
"I was wondering, is there any built in function that easily switches two array elements" |
Nervous Wreck (II) Inmate From: Sweden, Malmoe |
posted 02-02-2003 20:57
I tried searching the net on how to empty an array but all I came up with was to loop it through and set an empty value for each element. |
Lunatic (VI) Mad Scientist From: Massachusetts, USA |
posted 02-02-2003 21:20
To empty an array: |
Bipolar (III) Inmate From: Raleigh, NC |
posted 02-02-2003 22:07
ooh. that's cool slime. =D My mind is boggling |
Nervous Wreck (II) Inmate From: Utreg, NL |
posted 02-03-2003 09:14
If you'd need a swap function for arrays at various places in your code, you could add a "swap" (or something else) to the array prototype, for example; code: Array.prototype.swap = function(a, b) {
|
Nervous Wreck (II) Inmate From: Sweden, Malmoe |
posted 02-04-2003 21:57
Thanks Slime and Clay. I did not know of prototype... |