I\'m trying to find a way to move an object element to a specific position.
For example, I\'ve this object :
{
\"element1\" : {} // object,
\"el
JavaScript objects don't have ordering. You should use an array of objects instead.
var arr = [
{ id: 'element1' },
{ id: 'element2' },
{ id: 'element3' }
]
You could then reorder it something like:
var first = arr.splice(0, 1);
arr.push(first);
Maybe you could then grab specific elements based on id:
var out = arr.filter(function (el) {
return el.id === 'element1';
});