Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-19369

Add String.includes() polyfill

    XMLWordPrintableJSON

Details

    • Fully Compatible
    • Build 7 08/10/15

    Description

      types.js includes naive implementations of convenience helpers String.startsWith() and String.endsWith(). ES6 has these, and has also settled on "String.includes()" as the function for searching a string for a substring. This is a more readable version of .indexOf(foo) >= 0, which is what everyone otherwise does.

      Out of scope is improving these to accept the ES6 style optional second parameter to indicate where to start searching from.

      Attachments

        Activity

          People

            jonathan.reams@mongodb.com Jonathan Reams
            kevin.pulo@mongodb.com Kevin Pulo
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: