javascript - How to get item from JSON object when there is only one item? -


i have following json:

var x = [{"email":"info@test.nl"}]

how email in javascript? x.email doesn't work me.

bart

you need reference element of array, access property.

var x = [{"email":"info@test.nl"}]  console.log(x[0].email)


Comments

Popular posts from this blog

cookies - Yii2 Advanced - Share session between frontend and mainsite (duplicate of frontend for www) -

angular - password and confirm password field validation angular2 reactive forms -

javascript - Angular2 intelliJ config error.. Cannot find module '@angular/core' -