title: How to write JS function foo(baz) where baz is: function baz(para){alert(para.data);}
body: <p>I encountered this code; and I curiously tried to write a similar code structure. I am <strong>NOT</strong> taking about <strong>Geolocation</strong>.</p>
  
  <pre><code>    navigator.geolocation.getCurrentPosition(getPosition);
  
      function getPosition(position) 
      {
        alert(position.coords.latitude);
      }
  </code></pre>
  
  <p>How to write some function like <code>getCurrentPosition</code> that accepts a function with a parameter <code>getPosition(position)</code> and assigning object to the parameter <code>position</code> so that it is possible to read its properties like in <code>position.coords.latitude</code></p>
  
  <p>How to write a similar structure?<br>
  And, is it possible to write <code>getPosition(position)</code> so that it returns like this:</p>
  
  <pre><code>function getPosition(position) 
  {
    return position.coords.latitude;
  }
  </code></pre>