Convert Json object array to list of property values in angularjs

neha soni

I have this list of objects -

var o_list = [{id:1,name:jo},{id:2,name:mo}];

and I want to extract something like this -

var list = [1,2]

Is there anything already built or how can we implement this.

adeneo

You can just map it

var o_list = [{id:1,name:"jo"},{id:2,name:"mo"}];

var list = o_list.map(x => x.id);

document.body.innerHTML = '<pre>' + JSON.stringify(list, 0, 4) + '</pre>';

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

Select values of a column in an object json then convert it to array AngularJs

From Dev

Convert JSON array to Java Class Object List

From Dev

Retrieving all values of json object into array list

From Dev

Convert Object to Array angularjs

From Dev

convert array into an object angularjs

From Dev

angularjs - javascript - Convert object values from array to string

From Dev

angularjs - javascript - Convert object values from string to array structure

From Dev

AngularJS Convert Array to JSON

From Dev

AngularJS Convert Array to JSON

From Dev

Convert Array to JSON in AngularJS

From Dev

Convert List<Object[]> to JSON

From Dev

Convert object to JSON Array?

From Dev

Convert Json object to an array

From Dev

How to loop through json array to convert it into single values and list them?

From Dev

How to update JSON array into list object in angularjs controller

From Dev

Convert String containing list of JSON objects to Object Array

From Dev

AngularJS watch an object property in an object array

From Dev

Convert programmatically list of values to object

From Dev

Convert a list of Object values to a POJO

From Dev

convert array of object to object with array values

From Dev

Match multiple object property values on AngularJS typeahead

From Dev

Convert array of object to single object in javascript(Angularjs)

From Dev

Json array to a list of object

From Dev

C# Create object with dynamic properties : LINQ select List<object> values by property names array

From Dev

insert an array as an object property (json)

From Dev

insert an array as an object property (json)

From Java

Get an array of property values from an object array

From Dev

Convert an object into list or array MVC

From Dev

Trying to convert List<object> to an array

Related Related

  1. 1

    Select values of a column in an object json then convert it to array AngularJs

  2. 2

    Convert JSON array to Java Class Object List

  3. 3

    Retrieving all values of json object into array list

  4. 4

    Convert Object to Array angularjs

  5. 5

    convert array into an object angularjs

  6. 6

    angularjs - javascript - Convert object values from array to string

  7. 7

    angularjs - javascript - Convert object values from string to array structure

  8. 8

    AngularJS Convert Array to JSON

  9. 9

    AngularJS Convert Array to JSON

  10. 10

    Convert Array to JSON in AngularJS

  11. 11

    Convert List<Object[]> to JSON

  12. 12

    Convert object to JSON Array?

  13. 13

    Convert Json object to an array

  14. 14

    How to loop through json array to convert it into single values and list them?

  15. 15

    How to update JSON array into list object in angularjs controller

  16. 16

    Convert String containing list of JSON objects to Object Array

  17. 17

    AngularJS watch an object property in an object array

  18. 18

    Convert programmatically list of values to object

  19. 19

    Convert a list of Object values to a POJO

  20. 20

    convert array of object to object with array values

  21. 21

    Match multiple object property values on AngularJS typeahead

  22. 22

    Convert array of object to single object in javascript(Angularjs)

  23. 23

    Json array to a list of object

  24. 24

    C# Create object with dynamic properties : LINQ select List<object> values by property names array

  25. 25

    insert an array as an object property (json)

  26. 26

    insert an array as an object property (json)

  27. 27

    Get an array of property values from an object array

  28. 28

    Convert an object into list or array MVC

  29. 29

    Trying to convert List<object> to an array

HotTag

Archive