maria maria - 1 year ago 69
AngularJS Question

JavaScript make object to array only by messageid

Let's say I have the following:

{ messageid: '582b4350af7cb8f21e4b7b43',
_id: 582b4c79105387dd21e08004 } ,
{ messageid: '582b4350af7cb8f21e4b7xb43',
_id: 582b4c79105387dd21e08s004 }


How can I make it produce a array that would only be the
`s values?



Note: plain javascript or angular

Answer Source

You can use .map

var output = {
  return item.messageid;

This will create an array that will look like [582b4350af7cb8f21e4b7b43,582b4350af7cb8f21e4b7xb43]

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download