I have an array of objects and I'd like to push an element at the beginning of the of the array.
I have this:
var TheArray = TheObjects.Array;
TheArray.push(TheNewObject);
It's adding TheNewObject
at the end. Do I need to create a new array, add TheNewObject
to it and then loop through TheArray
and add each element the to the array?