object from List in Javascript -
this question has answer here:
- access object properties in javascript 2 answers
i'm trying call value out list , looks this:
[{ "gesundheitsamtid": 16, "name": "stadt dortmund", "telefonenummer": "0231 50-23606", "email": "gesundheitsamt@dortmund.de", "adresse": [{ "adresseid": 16, "strasse": "hövelstr.", "hausnr": "8", "ort": "dortmund", "plz": "44137" }] }, { "gesundheitsamtid": 70, "name": "stadt dortmund", "telefonenummer": "0231 50-23606", "email": "gesundheitsamt@dortmund.de", "adresse": [{ "adresseid": 70, "strasse": "hövelstr.", "hausnr": "8", "ort": "dortmund", "plz": "44137" }] }] i tried
var obj = ['adresse'][0].ort; but said
undefinedtype
const data = [{ "gesundheitsamtid": 16, "name": "stadt dortmund", "telefonenummer": "0231 50-23606", "email": "gesundheitsamt@dortmund.de", "adresse": [{ "adresseid": 16, "strasse": "hövelstr.", "hausnr": "8", "ort": "dortmund", "plz": "44137" }] }, { "gesundheitsamtid": 70, "name": "stadt dortmund", "telefonenummer": "0231 50-23606", "email": "gesundheitsamt@dortmund.de", "adresse": [{ "adresseid": 70, "strasse": "hövelstr.", "hausnr": "8", "ort": "dortmund", "plz": "44137" }] }] console.log(data[0].adresse[0].ort);
Comments
Post a Comment