title: Distance = rate * time calculation
body: <p>I am trying to write  an <strong>anonymous function in JavaScript</strong>  that will calculate and return the distance travelled using the formula rate * time. The function definition needs to be assigned to a variable. then the function needs to be called using that variable.</p>
  
  <p>But I am having trouble with the code, any pointed on what I'm doing wrong is appreciated.</p>
  
  <pre><code>&lt;html&gt;
  &lt;head&gt;&lt;title&gt;Anonymous Function&lt;/title&gt;
      &lt;script type="text/javascript"&gt;
  
      var d = function(){
      }
  
     return d;
   }
  
      &lt;/script&gt;
  &lt;/head&gt;
  &lt;body&gt;
  
     &lt;script type="text/javascript"&gt;
        var rate = prompt('how fast plan to drive (in mph)');
           rate = parseInt(rate);
        var time = prompt('how much time do you plan to drive? (in minutes)');
            time = parseInt(time);
        distance = rate * time;
        d = distance;
  &lt;/script&gt;
  &lt;/big&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>