Array question

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?