title: Storing in Global Variables
body: <p>I'm using Papa Parse to parse a local CSV file.</p>
  
  <p>When I print my updated objects to the console, I get the object to return with the changed values I have applied based on certain conditions.</p>
  
  <p>My problem is getting the image dimensions: Width and Height.</p>
  
  <p>Below is my script;</p>
  
  <pre><code>var w;
  var h;
  let testString = "s2345232";
  if (/^[s]\d+$/.test(testString) == true) {
      url = baseUrl + testString + suffix;
      getMeta(url, function(width, height) {
          w = width;
          h = height; 
          console.log(w, h); //works
      });  
  }
  console.log(w, h); // doesn't work
  // Here is the function to retrieve the image data
  function getMeta(url, callback) {
      var img = new Image();
      img.src = url;
      img.addEventListener("load", function() {
          callback(this.naturalWidth, this.naturalHeight);
      });
  };
  </code></pre>
  
  <p>What am I doing wrong and how can I fix it?</p>