json to split in elements in javascript -
{ "name": "chris", "age": "rip", "musketeers": ["athos", "aramis", "porthos", "d'artagnan"], "stooges": [ { "name": "moe" }, { "name": "larry" }, { "name": "curly" } ], "details": { "first": "michael", "last": "jackson" } }
output should be:
name :chris
age :rip
musketeers: athos,aramis,porthos,d'artagnan
stooges: name:moe name:larry name:curly
details: first :michael last:jackson
json valid js object. can name:var name=data.name;
, musketeers
var musketeers = data.musketeers; (var = 0; < musketeers.length; i++) { console.log(musketeers[i]); }
Comments
Post a Comment