Question: Is there a function in javascript to do this - test if a given value (a string in my case) exists in an array (of strings)? I know I could just loop over each value, but I'm wondering if js has a shorthand for this.

Answer: 
[jquery](http://jquery.com) has [.inArray()](http://api.jquery.com/jQuery.inArray/) method. It's the best I know..
For functions that are in php and should be in javascript or I haven't found yet I go to: <http://phpjs.org>

The function you want use if you're just using javascript is in\_array here: <http://phpjs.org/functions/in_array:432>

Otherwise, use the jQuery solution on this page.