String.prototype.trim

December 1, 2018 ยท View on GitHub

Build Status Coverage Status Greenkeeper badge WebReflection status

A String.prototype.trim polyfill for legacy browsers.

  • CDN via https://unpkg.com/@ungap/trim
  • ESM via import trim from '@ungap/trim'
  • CJS via const trim = require('@ungap/trim')

Compatible down to IE9, works well with ES5 shim upfront in IE8 (and maybe lower too).

Live test