On 20/05/12 16:31, Strager Neds wrote:
I don't see the point in adding String#contains if `str.indexOf(x)>=
0` is equivalent (just like with arrays).
`str.contains(x)' has a clearer intent than `str.indexOf(x) >= 0', in
your every-day app writer code. Though it's something that is rather
easy to write an abstraction for, it's still something that's used
mostly everywhere, so providing a convenience function for this
out-of-the-box still has its value, imho.
I'd usually favour generic primitives that can be easily composed
though, like a version of `fold' that supports earlier end-of-iteration,
such that you could write `some', `every', `find-first' and similar
easily on top of it.
_______________________________________________
es-discuss mailing list
[email protected]
https://mail.mozilla.org/listinfo/es-discuss