How can I get a value in a list of objectsFrom an array of objects, extract value of a property as arrayWhat is the most efficient way to deep clone an object in JavaScript?How do you get a timestamp in JavaScript?How to append something to an array?How do I loop through or enumerate a JavaScript object?How do I correctly clone a JavaScript object?Checking if a key exists in a JavaScript object?Sort array of objects by string property valueWhat does “use strict” do in JavaScript, and what is the reasoning behind it?Loop through an array in JavaScriptFor-each over an array in JavaScript?

How to prevent pickpocketing in busy bars?

How far in Advance do I need to book tickets on the West Highland Line in Scotland for a Multi-part Journey?

Fix Ethernet 10/100 PoE cable with 7 out of 8 wires alive

What can Thomas Cook customers who have not yet departed do now it has stopped operating?

Population of post-Soviet states. Why decreasing?

Does variance make sense in a fully immutable language?

Dynamic DataSource for Droplist in Content Editor

How to stop the death waves in my city?

Why does my browser attempt to download pages from http://clhs.lisp.se instead of viewing them normally?

A famous scholar sent me an unpublished draft of hers. Then she died. I think her work should be published. What should I do?

How deep is the liquid in a half-full hemisphere?

Can I build a half bath without permits?

Why is STARTTLS still used?

Why isn't there armor to protect from spells in the Potterverse?

As a team leader is it appropriate to bring in fundraiser candy?

Can a passenger predict that an airline is about to go bankrupt?

How much horsepower to weight is required for a 1:1 thrust ratio

Why does it seem the best way to make a living is to invest in real estate?

Is it possible to use && operator in terminal command template loop?

Pushing the e-pawn

split 1 column input into 5 column bed file

Beyond Futuristic Technology for an Alien Warship?

Maximize assigned tasks to each worker

Calculate the Ultraradical



How can I get a value in a list of objects


From an array of objects, extract value of a property as arrayWhat is the most efficient way to deep clone an object in JavaScript?How do you get a timestamp in JavaScript?How to append something to an array?How do I loop through or enumerate a JavaScript object?How do I correctly clone a JavaScript object?Checking if a key exists in a JavaScript object?Sort array of objects by string property valueWhat does “use strict” do in JavaScript, and what is the reasoning behind it?Loop through an array in JavaScriptFor-each over an array in JavaScript?






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;








-1















I have a list of objects




"Anne": age: 3, country: "USA" ,
"Flex": age: 5, country: "UK"



How can I get an array of country?
I can use Object.Values. How about in nested object in javascript?



["USA","UK"]









share|improve this question
























  • Related: From an array of objects, extract value of a property as array

    – Felix Kling
    Mar 28 at 19:19

















-1















I have a list of objects




"Anne": age: 3, country: "USA" ,
"Flex": age: 5, country: "UK"



How can I get an array of country?
I can use Object.Values. How about in nested object in javascript?



["USA","UK"]









share|improve this question
























  • Related: From an array of objects, extract value of a property as array

    – Felix Kling
    Mar 28 at 19:19













-1












-1








-1








I have a list of objects




"Anne": age: 3, country: "USA" ,
"Flex": age: 5, country: "UK"



How can I get an array of country?
I can use Object.Values. How about in nested object in javascript?



["USA","UK"]









share|improve this question














I have a list of objects




"Anne": age: 3, country: "USA" ,
"Flex": age: 5, country: "UK"



How can I get an array of country?
I can use Object.Values. How about in nested object in javascript?



["USA","UK"]






javascript object






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Mar 28 at 19:16









susu watarisusu watari

276 bronze badges




276 bronze badges















  • Related: From an array of objects, extract value of a property as array

    – Felix Kling
    Mar 28 at 19:19

















  • Related: From an array of objects, extract value of a property as array

    – Felix Kling
    Mar 28 at 19:19
















Related: From an array of objects, extract value of a property as array

– Felix Kling
Mar 28 at 19:19





Related: From an array of objects, extract value of a property as array

– Felix Kling
Mar 28 at 19:19












1 Answer
1






active

oldest

votes


















1
















 Object.values(input).map(it => it.country)


You could map the objects to their countries.






share|improve this answer



























    Your Answer






    StackExchange.ifUsing("editor", function ()
    StackExchange.using("externalEditor", function ()
    StackExchange.using("snippets", function ()
    StackExchange.snippets.init();
    );
    );
    , "code-snippets");

    StackExchange.ready(function()
    var channelOptions =
    tags: "".split(" "),
    id: "1"
    ;
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function()
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled)
    StackExchange.using("snippets", function()
    createEditor();
    );

    else
    createEditor();

    );

    function createEditor()
    StackExchange.prepareEditor(
    heartbeatType: 'answer',
    autoActivateHeartbeat: false,
    convertImagesToLinks: true,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: 10,
    bindNavPrevention: true,
    postfix: "",
    imageUploader:
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/4.0/"u003ecc by-sa 4.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    ,
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    );



    );














    draft saved

    draft discarded
















    StackExchange.ready(
    function ()
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55405308%2fhow-can-i-get-a-value-in-a-list-of-objects%23new-answer', 'question_page');

    );

    Post as a guest















    Required, but never shown

























    1 Answer
    1






    active

    oldest

    votes








    1 Answer
    1






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    1
















     Object.values(input).map(it => it.country)


    You could map the objects to their countries.






    share|improve this answer





























      1
















       Object.values(input).map(it => it.country)


      You could map the objects to their countries.






      share|improve this answer



























        1














        1










        1









         Object.values(input).map(it => it.country)


        You could map the objects to their countries.






        share|improve this answer













         Object.values(input).map(it => it.country)


        You could map the objects to their countries.







        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Mar 28 at 19:18









        Jonas WilmsJonas Wilms

        80.6k7 gold badges46 silver badges74 bronze badges




        80.6k7 gold badges46 silver badges74 bronze badges

































            draft saved

            draft discarded















































            Thanks for contributing an answer to Stack Overflow!


            • Please be sure to answer the question. Provide details and share your research!

            But avoid


            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.

            To learn more, see our tips on writing great answers.




            draft saved


            draft discarded














            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55405308%2fhow-can-i-get-a-value-in-a-list-of-objects%23new-answer', 'question_page');

            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown







            Popular posts from this blog

            Kamusi Yaliyomo Aina za kamusi | Muundo wa kamusi | Faida za kamusi | Dhima ya picha katika kamusi | Marejeo | Tazama pia | Viungo vya nje | UrambazajiKuhusu kamusiGo-SwahiliWiki-KamusiKamusi ya Kiswahili na Kiingerezakuihariri na kuongeza habari

            SQL error code 1064 with creating Laravel foreign keysForeign key constraints: When to use ON UPDATE and ON DELETEDropping column with foreign key Laravel error: General error: 1025 Error on renameLaravel SQL Can't create tableLaravel Migration foreign key errorLaravel php artisan migrate:refresh giving a syntax errorSQLSTATE[42S01]: Base table or view already exists or Base table or view already exists: 1050 Tableerror in migrating laravel file to xampp serverSyntax error or access violation: 1064:syntax to use near 'unsigned not null, modelName varchar(191) not null, title varchar(191) not nLaravel cannot create new table field in mysqlLaravel 5.7:Last migration creates table but is not registered in the migration table

            은진 송씨 목차 역사 본관 분파 인물 조선 왕실과의 인척 관계 집성촌 항렬자 인구 같이 보기 각주 둘러보기 메뉴은진 송씨세종실록 149권, 지리지 충청도 공주목 은진현