I have the following array of object.
response: [0]
Data: '455'
[1]
Data: '456'
[2]
Data: '457'
var normalizedArray = newlist.map(function (obj) {
return obj.Data;
});
I am able to convert the above array of Object into an array 'notmalizedArray' using the above function. this works and gives me following output.
normalizedArray= ['455', '456', '457'];
If instead of only 1 element, i have following array of objects.
response: [0]
Data: '455'
Note: 'tre'
Id: '4'
[1]
Data: '456'
Note: 'bre'
Id: '5'
[2]
Data: '457'
Note: 'cre'
Id: '6'
I want the following array output for the above array of objects.
normalizedArray = ['455', 'tre', '4', '456', 'bre', '5', '457', 'cre', '6']
Can someone let me know what should be changed in the below function to achive above shown normalizedArray.
var normalizedArray = newlist.map(function (obj) {
return obj.Data;
});