[flexcoders] Assigning arrays...
I need to copy one array to another -- NOT copy a reference to the array... For example: array1 = array2 will simply copy a reference to array2 into array1. I want to do something like this: array1 = new Array(array2). Of course, that doesn't work... It simply creates a blank array that's pre-allocated to be the length of whatever array2's length was... (At least that's what I think is going on...) Anyway -- how do I copy one array to another, without looping through the entire array?
Re: [flexcoders] Assigning arrays...
Array.splice method (Array.concat or Array.join) check the docs I don;t know them by heart. C From: Laurence lmacne...@comcast.net To: flexcoders@yahoogroups.com Sent: Thu, February 4, 2010 6:02:46 PM Subject: [flexcoders] Assigning arrays... I need to copy one array to another -- NOT copy a reference to the array... For example: array1 = array2 will simply copy a reference to array2 into array1. I want to do something like this: array1 = new Array(array2) . Of course, that doesn't work... It simply creates a blank array that's pre-allocated to be the length of whatever array2's length was... (At least that's what I think is going on...) Anyway -- how do I copy one array to another, without looping through the entire array?
Re: [flexcoders] Assigning arrays...
ObjectUtil.copy() ? On Thu, Feb 4, 2010 at 6:10 PM, claudiu ursica the_bran...@yahoo.comwrote: Array.splice method (Array.concat or Array.join) check the docs I don;t know them by heart. C -- *From:* Laurence lmacne...@comcast.net *To:* flexcoders@yahoogroups.com *Sent:* Thu, February 4, 2010 6:02:46 PM *Subject:* [flexcoders] Assigning arrays... I need to copy one array to another -- NOT copy a reference to the array... For example: array1 = array2 will simply copy a reference to array2 into array1. I want to do something like this: array1 = new Array(array2) . Of course, that doesn't work... It simply creates a blank array that's pre-allocated to be the length of whatever array2's length was... (At least that's what I think is going on...) Anyway -- how do I copy one array to another, without looping through the entire array? -- Fotis Chatzinikos, Ph.D. Founder, LivinData Technologies www.styledropper.com fotis.chatzini...@gmail.com,