Имею JSON файл, нужно получить все элементы urn;
[
{
"name": "One",
"children": [{
"urn": "urnOne"
}, {
"name": "ChildrenOne",
}
]
}, {
"name": "Two",
"children": [{
"urn": "urnTwo"
}, {
"name": "ChildrenTwo",
}
]
}
]
Мой код с этим не справляется.
fetch('./viewables.json')
.then(response => ./json.json())
.then(data => {
data.forEach((el, i) => {
data[i].children.urn;
})
});