use array.indexOf when available