array of json objects javascript code example
Example 1: json arrays
{
"array": [{1,2,3,4,5,6}]
}
Example 2: javascript create json object from array
var array = ['a', 1, 'b', 2, 'c', 3],
object = {},
i
for (var i = 0; i < array.length; i += 2) {
object[array[i]] = array[i + 1];
}
console.log(object);
Example 3: json object array
const Object = {a:1,
b:'ab'
};
const Array = [1,
'ab',
4
];