Javascript Array delete_unless(matcher)
Array.prototype.delete_unless = function(matcher){ this.delete_if(function(item){ return !matcher(item) })//ww w . j a va 2s . c o m }