Optionally ignoring case in String.prototype.contains()?

Rick Waldron waldron.rick at gmail.com
Wed Aug 28 14:26:11 PDT 2013


On Wed, Aug 28, 2013 at 11:19 AM, Axel Rauschmayer <axel at rauschma.de> wrote:

> Suggestion: a named parameter `ignoreCase`:
>
>     $ 'hello world'.contains('WORLD')
>     false
>
>     $ 'hello world'.contains('WORLD', { ignoreCase: true })
>     true
>



This would create inconsistency with indexOf and lastIndexOf, which already
have a specified second argument. It's really not painful to make the two
strings the same case in user code if ignoring case is desired.

Rick
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20130828/8d86f3b2/attachment.html>


More information about the es-discuss mailing list