title: Fetch nested object property using lodash
body: <p>I've a nested object with a country code. I need to fetch the corresponding currency property using lodash based on the condition.</p>
  
  <p>I'm a newbie to lodash and not sure which method can I use here. </p>
  
  <p>For e.g., 
  When I search for corresponding currencies for the countryCode 'AU', it should return 'AUD'.</p>
  
  <p>Currently, I get the entire object.</p>
  
  <p>How do I get this done?</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>var myJSON = {
    "countryCode": {
    "Australia": "AU",
    "United States": "US",
    "Britain": "GB",
    "Japan": "JP",
    "India": "IND",
    "France": "FR",
    "Russia": "RS"
  },
  "countries": {
    "AE": {
      "currencies": {
      "AED": {
        "isDefault": true
      }
      }
    },
    "AL": {
      "currencies": {
      "ALL": {
        "isDefault": true
      }
      }
    },
    "AU": {
      "currencies": {
      "AUD": {
        "isDefault": true
      }
      }
    },
    "US": {
      "currencies": {
      "USD": {
        "isDefault": true
      }
      }
    },
    "GB": {
      "currencies": {
      "EUR": {
        "isDefault": true
      }
      }
    },
    "FR": {
      "currencies": {
      "EUR": {
        "isDefault": true
      }
      }
    },
    "JP": {
      "currencies": {
      "JPY": {
        "isDefault": true
      }
      }
    },
    "RS": {
      "currencies": {
      "RSD": {
        "isDefault": false
      }
      }
    },
    "ZA": {
      "currencies": {
      "ZAR": {
        "isDefault": true
      }
      }
    }
    }
  };
  
  function getData() {
   var countryCode = ['AU', 'ZA', 'JP'];
   console.log(_.pick(myJSON.countries, countryCode));
   console.log(_.values(_.pick(myJSON.countries, countryCode))); 
  }</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;script src="https://cdnjs.cloudflare.com/ajax/libs/lodash.js/4.17.5/lodash.core.js"&gt;&lt;/script&gt;
  &lt;button onclick="getData()"&gt;Get Data&lt;/button&gt;</code></pre>
  </div>
  </div>
  </p>
  
  <p>Current Output:
  {AU: {…}, ZA: {…}, JP: {…}}</p>
  
  <p>Desired Output:</p>
  
  <p>['AUD', 'ZAR', 'JP']</p>
  
  <p>Here's the code:</p>