I have the following data as a nested array please see the below fiddle https://jsfiddle.net/athulmathew/z3s1w0mu/ I want to get the output from the array-like below
var item {caller_number_raw : data from the array,company_id:data from the array}
I tried to sort it like this
for (i in data.data.hits) {
for (j in data.data.hits[i]._source) {
//str += data.data.hits[i]._source[j] + "<br/>";
var Item ={CallerID:data.data.hits[i]._source[j].caller_number}
console.log(Item)
}
}
but returns an empty object "{}" I am not that familiar with nested arrays can anybody help me what I am doing wrong here