Pass values to javascript array filter?
<p>How can one pass a variable to a filter function in javascript?</p>

<p>In this case I'm trying to pass a value to variable "maxage":</p>

<pre><code>var dateFilter = function(value,maxage) { // Age in miliseconds
    if(Date.now() - value &lt; maxage) {
        return value;
        } else {
        return false;
        }
    }

    dates.filter(dateFilter,500);
</code></pre>

<p>How can I pass the value <code>500</code> to the filter as <code>maxage</code>?</p>
