You can use Array.prototype.map for that:

var arr = [
  {"text":"demo1"},
  {"text":"demo2"}
];
var texts = arr.map(function(el) {
  return el.text;
});
console.log(texts);

And with ES6, you can use arrow functions:

var texts = arr.map((el) => el.text);
Answer from str on Stack Overflow
🌐
O'Reilly
oreilly.com › library › view › learning-angularjs › 9780134035147 › ch01lev2sec25.html
Converting an Array into a String - Learning AngularJS [Book]
A very useful feature of Array objects is the capability to combine the elements of a string to make a String object, separated by a specific separator using the join() method.
Find elsewhere
🌐
ItSolutionstuff
itsolutionstuff.com › post › how-to-convert-array-into-comma-separated-string-in-angularexample.html
How to Convert Array into Comma Separated String in Angular? - ItSolutionstuff.com
May 2, 2024 - you can easily convert array to string in angular 6, angular 7, angular 8, angular 9, angular 10, angular 11, angular 12, angular 13, angular 14, angular 15, angular 16 and angular 17 project.
🌐
Stack Overflow
stackoverflow.com › questions › 42424492 › converting-an-object-to-an-array-in-angular2-typescript
angular - converting an object to an array in angular2 typescript - Stack Overflow
res => { this.categories = res; let newitem:string[]; for(var i=0; i<res.length; i++){ this.categories.map((category, i2) => category.no = i+1);//this adds no i,2,3... var obj = res[i].assigned; //array item let stringArray: Array<any> = []; for(var i3 =0; i<obj.length; i++){ stringArray.push(obj[i3].truck_subtype); } this.categories.map((category, i4) => category.assigned= stringArray) } }