title: Check if Geolocation is saved before returning value
body: <h2>What I'm trying to do:</h2>
  
  <p>I need to request the user's location and save the latitude &amp; longitude into an object. Since this may take some time, I need to occasionally check to see if the coordinates have been saved. I am using a setTimeout to check to see if the coordinates have been saved every 500ms. Once ` </p>
  
  <h2>The problem:</h2>
  
  <p><code>checkCoords()</code> runs once and returns "user coords doesn't exist", however it seems like it does not continue to run.</p>
  
  <p>What would be the best way to make sure <code>userGeometry</code> is returned once the coordinates have been saved?</p>
  
  <pre><code>EXAMPLE.GetUserGeometry = function() {
    console.log("Starting geolocation...");
  
    var userGeometry = navigator.geolocation.getCurrentPosition(save_location);
  
    function save_location(position) {
      var user_coordinates = {
        latitude: position.coords.latitude,
        longitude: position.coords.longitude
      };
  
      console.log(user_coordinates);
      return user_coordinates;
    }
  
    setTimeout(checkCoords(userGeometry), 500);
  
    function checkCoords(coords) {
      if (typeof coords === 'undefined') {
        console.log("user coords don't exist");
      } else {
        console.log("user coords saved");
      }
    }
  
  };
  </code></pre>