# Push to an array, but at the beginning

**URL:** <https://forum.kirupa.com/t/push-to-an-array-but-at-the-beginning/279130>\
**Category:** Uncategorized\
**Created:** [January 9, 2009, 8:56pm UTC](https://forum.kirupa.com/t/push-to-an-array-but-at-the-beginning/279130 "2009-01-09T20:56:35Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Iamthejuggler](https://avatars.discourse-cdn.com/v4/letter/i/ecc23a/32.png) [@Iamthejuggler](https://forum.kirupa.com/u/Iamthejuggler)\
**Post date:** [January 9, 2009, 8:56pm UTC](https://forum.kirupa.com/t/push-to-an-array-but-at-the-beginning/279130/1 "2009-01-09T20:56:35Z")

</div>

I know this is probably a simple question, but i’ve had a bit to drink and can’t come up with a good solution.

I want to be able to do the same as the push function on array, but it adds to the start of the array. I assume i’ll need a custom function to do it, but have so far just failed.

example:

a is an array [[1,1,1,1],[2,2,2,2],[3,3,3,3]]  
and i want to push [0,0,0,0] into the start so that it becomes [[0,0,0,0],[1,1,1,1],[2,2,2,2],[3,3,3,3]]

Am i missing an obvious trick here? Any help would be appreciated.
