nektro / js-polyfills

Some ECMAScript functions you've always wanted but never had...

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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

About

Some ECMAScript functions you've always wanted but never had...


Languages

Language:JavaScript 100.0%