I'm trying to get values from external json file and save some values in array. My code :
$.getJSON("https://link.to.my.json", function(data) {
console.log(data); // this will show the info it in console
});
So I can get data from json but I'm not sure how I can add first and last name to array [bob rooppo, peter sticker]. Any help would be appreciated and my json:
{
"users": [
{
"test": "123",
"name": {
"first": "bob",
"last": "roppo"
},
"email": "bob@gmail.com",
"phone": "+123456789"
},
{
"test": "124",
"name": {
"first": "peter",
"last": "sticer"
},
"email": "peter@gmail.com",
"phone": "+123456789"
}
]
}