I have an array that looks like this
const array: any[] = []
array.push({ 'Comments': this.comment, 'Name': this.name, 'Description' : this.description })
You can use forEach loop :
array.forEach(function(object) {
var comment = object.Comments;
commentArray.push(comment);
});
//You can store all comments in another array and use it...
console.log("This is comment array...", commentArray);
Or use map but it will work in new browsers possibly ones following ES6:
commentArray = array.map(function(object) {
return object.Comments;
});
console.log("This is comment array... ", commentArray);