javascript and this
<pre><code>function distance(r,t){
        this.rate = r,
        this.time = t,
        this.calculate = function() {return rate * time ;};
        return this;
}

var trip1 = distance(2,4);
var trip2 = distance(5,7);
var trip3 = distance(3,10);
document.write("&lt;br&gt;trip1: " + trip1.calculate());
document.write("&lt;br&gt;trip2: " + trip2.calculate());
document.write("&lt;br&gt;trip3: " + trip3.calculate()); 
</code></pre>

<p><strong>ouput</strong></p>

<pre><code>trip1: 30
trip2: 30
trip3: 30
</code></pre>

<p>Shouldn't the output be</p>

<pre><code>trip1: 8
trip2: 35
trip3: 30
</code></pre>
