Skip to content

Extend your JavaScript Number type with a ~100 bytes polyfill

License

Notifications You must be signed in to change notification settings

micheleriva/range-prototype

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Range Prototype

Build Status License: MIT

Extend your JavaScript Number type with a 100 bytes polyfill:

require('range-prototype')

const list = [...10] // => [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 ]

Installation

yarn

$ yarn add range-prototype

npm

$ npm install range-prototype

then simply require it in your project:

require('range-prototype')

For old browsers

<script src="https://cdn.jsdelivr.net/npm/range-prototype@0.0.1/es5.js"></script>

<script>
[...5] // => [ 0, 1, 2, 3, 4 ]
</script>

License

MIT