I want to push information to an array I have created. The thing is I want to push the info to be first in the array, or at index 0. How do I do this?
I want to avoid having to reverse the array to get the most recent first as this makes things much complicated later..
e.g, my array may look like:
{"entry1":"entry1-value"}, {"entry2":"entry2-value"}
and I want to push a new value to be first:
{"newEntry":"newEntry-value"},{"entry1":"entry1-value"},{"entry2":"entry2-value"}
No comments:
Post a Comment