Using JavaScript; how do I produce this output
cell
work (123) 456 7890
from this valid json
{"phone": [
{
"@attributes": {
"type": "cell",
"ext": ""
}
}, "(123) 456 7890", {
"@attributes": {
"type": "work",
"ext": ""
}
}
]}
[{"type": "cell"}, {"type": "work", "number":"(123) 456 7890"}]. This looks to be automatically generated from an XML document. If that's the case, you should parse that XML instead.phoneis an array. You want to access the second element. I don't see where the problem could be?