3 ms·
Determine the index of the first parameter in the Array … Ah, it returns the index. But that’s OK … JavaScript supports the notion of “truthiness”, Except
by tlrobinson 18y ago
Determine the index of the first parameter in the Array …
Ah, it returns the index. But that’s OK … JavaScript supports the notion of “truthiness”,
Except if it returns "0", of course.
It's a very C-like way of doing things:
if ($.inArray(blah blah) < 0)
// not found!
- deleted 18y ago[deleted]