Answers for "array of object to json"

0

js array to json

// Array to JSON:
const jsonString = JSON.stringify(yourArray);
// JSON to Object / Array
const yourData = JSON.parse(jsonString);
Posted by: Guest on February-24-2021
0

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);
Posted by: Guest on September-17-2020
0

Array as JSON

const text = '["Ford", "BMW", "Audi", "Fiat"]';

const myArr = JSON.parse(text);
Posted by: Guest on August-05-2021

Code answers related to "array of object to json"

Code answers related to "Javascript"

Browse Popular Code Answers by Language