general javascript
<p>i havent written in js in awhile and am a bit rusty apparently.  trying to understand the following problem.  the alert in <code>getCurrentPosition successCallback</code> shows the latitude correctly, but the last line alerts <code>undefined</code>.  why isnt my client_location function returning the latitude when call outside the function?</p>

<pre><code>client_location = function() {
  if (navigator.geolocation) {
    return navigator.geolocation.getCurrentPosition(function(position) {
      alert(position.coords.latitude);  ## RETURNS LATITUDE CORRECTLY ##
      return position.coords.latitude;
    });
  }
};
alert(client_location());               ## RETURNS UNDEFINED ##
</code></pre>
