JavaScript card game and hand evaluation
Your sorting of cards to buckets takes a lot of code, which is because the names of your buckets don't match with the names of cards. The cards have just numeric values (10, 11), while buckets are named with words (ten_bucket, j_bucket). I would represent the cards as such:

{kind: 3, suit: "club"},
{kind: 10, suit: "heart"},
{kind: "K", suit: "spade"},
{wild: true},


And then I could write a much simpler algorithm for putting them to buckets:

var wilds = [];
var kinds = {3:[], 4:[], 5:[], 6:[], 7:[], 8:[], 9:[], 10:[], J:[], Q:[], K:[]};

hand.forEach(function(card) {
    if (card.wild) {
        wilds.push(card);
    } else {
        kinds[card.kind].push(card);
    }
});


I'm also handling the wild cards as a completely separate category, which makes it much easier to check if we have three-of-a-kind:

for (var k in kinds){
    if (kinds.hasOwnProperty(k)){
        if (kinds[k].length + wilds.length &gt;= 3) {
            // Yes, we have a three-of-a-kind
        }
    }
}


Checking for runs

A basic check for runs is quite simple. You just loop through all the buckets in order and check for the longest sequence without holes:

function longest_run() {
    var count = 0;
    var max_run = 0;
    ["3", "4", "5", "6", "7", "8", "9", "10", "J", "Q", "K"].forEach(function(k) {
        if (kinds[k].length &gt;= 1) {
            count += 1;
        } else {
            if (count &gt; max_run) {
                max_run = count;
            }
            count = 0;
        }
    });
    return max_run;
}


But taking the wild cards into account complicates the whole thing considerably. Now it really becomes a question of combinatorics. A brute-force approach would be to try using the wildcards in each of the empty positions. This can be optimized of course, but I suggest you turn to StackOverflow with this question - some math-minded people might be able to provide you with a better algorithm over there.