I'm on the fence about your proposal. Returning null is a natural way
to indicate that no such index exists, and would play nicely with
null-safety operators, as you say. On the other hand, returning -1 is
well-known behavior in JavaScript and Java (and many others), and
given Dart's explicit focus on familiarity, I'm not sure that the
benefits are sufficient.
I'm definitely in favor of Collection#contains, but it is orthogonal
to whether indexOf() returns -1 or null.
Cheers,
Josh
> --
> Consider asking HOWTO questions at Stack Overflow:
>
http://stackoverflow.com/tags/dart
>
>