I have the following object array in my JavaScript code.
var data = [
{
ACC_OBSERVACIONES: 'Ninguna',
COLOR: 'Rojo',
MARCA: 'BMW',
MODELO: 'i8',
NOMBRE: 'Hoose'},
{
ACC_OBSERVACIONES: 'Ninguna',
COLOR: 'Verde',
MARCA: 'Merdedes Benz',
MODELO: '32432',
NOMBRE: 'Pedro'
}
];
I would like to be able to change the order of the keys in my object. Is it possible to do this?
var data = [
{
MARCA: 'BMW',
MODELO: 'i8',
COLOR: 'Rojo',
ACC_OBSERVACIONES: 'Ninguna',
NOMBRE: 'Hoose'},
{
MARCA: 'Merdedes Benz',
MODELO: '32432',
COLOR: 'Verde',
ACC_OBSERVACIONES: 'Ninguna',
NOMBRE: 'Pedro'
}
];
I noticed that the keys are alphabetized automatically, can I change the order of the keys my way? My problem is that I need to change the order of the keys because I use a plugin that loads the data of the variable, but it loads them in the order that they come and that order does not help me.