title: Accessing json data issue
body: <p>I know there are many questions about this issue but  my problem is different  I managed to get the data outside of $.getJSON()  but I couldn't access them </p>
  
  <pre><code> var country = {} ; 
  
       $.getJSON('https://freegeoip.net/json/', function (code) { 
  
          country.config = code ;
  
    });
  
  console.log(country);
  </code></pre>
  
  <p>I will get these information</p>
  
  <blockquote>
    <p>{}config: {ip: "**********", country_code: "LB", country_name:
    "Lebanon", region_code: "06", region_name: "Beirut", …}<strong>proto</strong>:
    Object</p>
  </blockquote>
  
  <p>if I try to access them like this </p>
  
  <blockquote>
    <p>country.config.country_code</p>
  </blockquote>
  
  <p>I will get this error</p>
  
  <blockquote>
    <p>fdgdfgd:643 Uncaught TypeError: Cannot read property 'country_code' of
    undefined</p>
  </blockquote>
  
  <p>I can't even access this one </p>
  
  <blockquote>
    <p>country.config</p>
  </blockquote>
  
  <p>How can I get the data from this object ?</p>