How to create an array of a given value recursively?
<p>I'm trying to work on recursion with javascript, and I'm having trouble figuring out how to do this recursively. For example, <code>fillArray(num, len)</code> with <code>num = 5</code>, and <code>len = 3</code>, would return <code>[5,5,5]</code>. I'm honestly stuck, and I haven't been able to make progress on this. It's not much, but this is what I have. Could someone please help? </p>

<pre><code>var fillArray = function(num, len) {
    var list = [];
    if (length === 0) {
        return [];
    } 
    return list.concat(function(value, length--));
}
</code></pre>