Is there a simple way to remove the key = parseInt( key );
and get the key direct as integer from the for?
for( var key in object.items )
{
key = parseInt( key );
}
Edit for better understanding
object.items is a object with ids as keys. But not a array.
object.items = {
"123": "somthing",
"745": "somthing",
"975": "somthing"
}
This will extract the keys for you:
Object.keys(object.items);
Now if we want all of them as integer.
Object.keys(object.items).map(Number);