I just came up with an inArray implementation for javascript and it's working fine. Its weird but short, and i've got this feeling that there's something wrong with it, but i'm not sure what it is:
Array.prototype.inArray = function (itm) {
return this.join("|").match( new RegExp('\\b'+itm+'\\b','ig') );
}
UPDATE: this is supposed to be a general implementation of an inArray feature. I'm not sure which is more expensive, doing a loop or creating a regex