# How to duplicate an Array with out binding it to the original?

**URL:** <https://forum.kirupa.com/t/how-to-duplicate-an-array-with-out-binding-it-to-the-original/241967>\
**Category:** Uncategorized\
**Created:** [October 20, 2007, 3:24am UTC](https://forum.kirupa.com/t/how-to-duplicate-an-array-with-out-binding-it-to-the-original/241967 "2007-10-20T03:24:21Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![joshchernoff](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/joshchernoff/32/1852_2.png) [@joshchernoff](https://forum.kirupa.com/u/joshchernoff)\
**Post date:** [October 20, 2007, 3:24am UTC](https://forum.kirupa.com/t/how-to-duplicate-an-array-with-out-binding-it-to-the-original/241967/1 "2007-10-20T03:24:21Z")

</div>

```php

var array1:Array;
var array2:Array;

testArray(new Array(1,2,3));

function testArray(e:Array):void{
    array1 = e;
    array2 = e;
    
    array1[0] = 4;
    trace(array2[0]); // outputs 4 but should be 1
}

```

this is a binding problem that I can’t figure out.  
I have tried to make a new array before “array1 = e” but it just overrides the old array with the new one and not copying it but binding it to the original array.

help me please I have a job to finish tonight 😟
