just can't say if ($.inArray("value", array) > -1) { // found in array? }
On Mar 23, 2:59 pm, Mike521 <mi...@favorfavor.com> wrote: > I was about to use inArray (http://docs.jquery.com/Utilities/ > jQuery.inArray) to determine if an element was in an array or not, but > I realized I can't use it as a true/false response since it returns > the position (and could return 0 if the element was found in position > 0 - returns -1 if not found). I was expecting something with the same > functionality as the PHP function in_array (http://us3.php.net/ > in_array) > > I know it's a minor point but wouldn't it be more intuitive if called > arrayPosition? with a name like that I'd expect the functionality it > has now.