Skip to content

Latest commit

 

History

History
18 lines (17 loc) · 838 Bytes

README.md

File metadata and controls

18 lines (17 loc) · 838 Bytes

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