# Array question

**URL:** <https://forum.kirupa.com/t/array-question/191576>\
**Category:** Uncategorized\
**Created:** [June 21, 2006, 2:17pm UTC](https://forum.kirupa.com/t/array-question/191576 "2006-06-21T14:17:33Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![budbuck](https://avatars.discourse-cdn.com/v4/letter/b/e480ec/32.png) [@budbuck](https://forum.kirupa.com/u/budbuck)\
**Post date:** [June 21, 2006, 2:17pm UTC](https://forum.kirupa.com/t/array-question/191576/1 "2006-06-21T14:17:33Z")

</div>

I have 2 arrays, let’s just say aSubArray and aMainArray.

I set the values for aSubArray then use aMainArray.push(aSubArray); When I go to change the values for aSubArray, in the case of a for loop, all references in aMainArray are changed.

How can a pass the values of aSubArray to aMainArray, rather than just a reference?
