Remove specific values from an array.
function removeFromArray(value, array) { return $.grep(array, function(elem, index) { return elem !== value; }); }