It depends on your purpose. If you program for the Web, avoid indexOfindexOf, it isn't supported by IE6Internet Explorer 6 (lot of them still used!), or do conditional use:
if (yourArray.indexOf !== undefined) result = yourArray.indexOf(target); else result = customSlowerSearch(yourArray, target); indexOfindexOf is probably coded in native code, so it is faster than anything you can do in JSJavaScript (except binary search/dichotomy if the array is appropriate). Note: it is a question of taste, but I would do a return false; at the end of your routine, to return a true booleanBoolean...