ketan pradhan ketan pradhan - 1 year ago 89
AngularJS Question

Convert array of objects to array of strings in angularjs

{ "text": "demo1" },
{ "text": "demo2" }


["demo1", "demo2"]

I have tried using reduce()

str str
Answer Source

You can use for that:

var arr = [
var texts = {
  return el.text;

And with ES6, you can use arrow functions:

var texts = => el.text);
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download