Get rid of recursion in fruit picker
Micnic was almost there, but I think that you can lose the recursion completely by separating your if statement into several if statements

function choose(num){
    var looped = false;
    while (!looped) {
        if (num &lt; 30 &amp;&amp; apple &gt; 0) {
            fruit.push("apple");
            apple--;
            return "added apple";    
        }
        if (num &lt; 70 &amp;&amp; kiwi &gt; 0) {
            fruit.push("kiwi");
            kiwi--;
            return "added kiwi";
        }
        if (num &lt; 90 &amp;&amp; banana &gt; 0) {
            fruit.push("banana");
            banana--;
            return "added banana";
        }
        if (grapes &gt; 0) {
            fruit.push("grapes");
            grapes--;
            return "added grapes";
        } else {
            if (looped) {
                return "no fruit left";
            }
            num = 1;
            looped = true;
        }
    }
};


This will remove the recursion (sounds like that is what you want to do)  and will still cascade through the fruit.  notice that if the number is 95 and there are no grapes it will still recursively call the choose function with a number of 1 to cover the rest of the fruit, The only difference here is that you don't have the recursive call in every if statement, and you have less than half of the if statement calls.  I also made sure that the this wouldn't loop more than once by implementing a while loop that will only ever loop once.

If the number is 40 it will start at checking for kiwi's if there are none then then it will check for bananas.

I think this is exactly what you were looking for.

I don't like a function returning undefined, so I added the return "added {fruit}";  but you could just have return; if that is your preference.