is there any function to get the keys of an array using javascript
Also i want to reverse and array
eg:
appz_variable['412cc16e']="ABXZ";
appz_variable['axecr6fd']="YCSET";
I want the array indexes or keys in reverse order
is there any function to get the keys of an array using javascript Also i want to reverse and array eg:
I want the array indexes or keys in reverse order |
|||||||
|
I assume here you're talking about an object which some label (albeit incorrectly) an "associative array". For that situation, use a
For a normal array you just loop though based on index, like this:
The second is iterating over the array, while the first is enumerating the object...you shouldn't use a |
|||||||||||
|
You can index your array by numbers when it is created. perhaps like this:
and then you will have an "order" which you can then reverse... |
|||
|