Some ECMAScript functions you've always wanted but never had...
JavaScript
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
src
README.md
package.json

README.md

js-polyfills

Some ECMAScript function you've always wanted but never had access to...


String.prototype.replaceAll
`(with, what)` :: Replace all occurences of {with} with {what}
Array.prototype.random
`()` :: Return the value of this Array at a random index
HTMLCollection.prototype.indexOf
`(i)` :: Alias of Array.prototype.indexOf for HTMLCollection
HTMLCollection.prototype.forEach
`(fn(v,i))` :: Alias of Array.prototype.forEach for HTMLCollection
Array.prototype.powerSet
`()` :: Return the [power set](https://en.wikipedia.org/wiki/Power_set) of this Array as an Iterable
Array.prototype.clean
`(v)` :: Return this Array with all occurences of `{v}` removed