On Wed, Jul 5, 2017 at 7:10 PM, Boris Cherny <[email protected]> wrote: > The use case is similar to Scala’s block scoped implicits. In my > application code I want Array.prototype.indexOf to return an > Option<number>, rather than number | -1.
Why does it have to be called `indexOf`? Why not `fooIndexOf`, where `foo` is a short app-specific prefix? Changing the meaning of `indexOf` seems like changing black to white and running the risk of getting killed at the next zebra crossing. On Wed, Jul 5, 2017 at 7:42 PM, Boris Cherny <[email protected]> wrote: > I tried that approach, but it doesn’t work when creating objects > via literal notation ([], {}). A bit clumsy to have to write > “new Array(1,2,3)", or “Array(1,2,3)” every time. Surely not too bad if you provide yourself a short array-creation wrapper, like `a`? -- T.J. Crowder
_______________________________________________ es-discuss mailing list [email protected] https://mail.mozilla.org/listinfo/es-discuss

