Sign Up for Free

RunKit +

Try any Node.js package right in your browser

This is a playground to test code. It runs a full Node.js environment and already has all of npm’s 1,000,000+ packages pre-installed, including string.prototype.endswith with all npm packages installed. Try it out:

var stringPrototypeEndswith = require("string.prototype.endswith")

This service is provided by RunKit and is not affiliated with npm, Inc or the package authors.

string.prototype.endswith v1.0.0

A robust & optimized `String.prototype.endsWith` polyfill, based on the ECMAScript 6 specification.

ES6 String.prototype.endsWith polyfill Build status

A robust & optimized polyfill for the String.prototype.endsWith method in ECMAScript 6.

This package implements the es-shim API interface. It works in an ES3-supported environment and complies with the spec.

Other polyfills for String.prototype.endsWith are available:

Installation

Via npm:

npm install string.prototype.endswith

Then, in Node.js:

var endsWith = require('string.prototype.endswith');
<script src="https://bundle.run/string.prototype.endswith"></script>

NOTE: It's recommended that you install this module using a package manager such as npm, because loading multiple polyfills from a CDN (such as bundle.run) will lead to duplicated code.

Notes

Polyfills + test suites for String.prototype.startsWith and String.prototype.contains are available, too.

Author

twitter/mathias
Mathias Bynens

License

This polyfill is available under the MIT license.

RunKit is a free, in-browser JavaScript dev environment for prototyping Node.js code, with every npm package installed. Sign up to share your code.
Sign Up for Free