Javascript - Json array with javascript, Json script to add states

Json array with javascript


How to create a array in json?

By using the simple javascript function as below you can create a simple array in json

var head = { "data" : [ { "name" : "Math", "place" : "Alaska" },
{ "name" : "Danial", "place" : "Texas" },
{ "name" : "Peter", "place" : "virginia" }
],
}

for(var i=0; i<=head.data.length; i++) {
document.writeln(head.data[i].name + '===> ' + head.data[i].place);
}

The topic on Javascript - Json array with javascript is posted by - Math

Hope you have enjoyed, Javascript - Json array with javascriptThanks for your time

Tech Bluff