array-fill
[].fill
Last updated 12 years ago by 1000ch .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ npm install array-fill 
SYNC missed versions from official npm registry.

array-fill Build Status

Polyfill for Array.prototype.fill.

testling badge

Usage

Functionally:

var fill = require('array-fill');

console.log(fill([1, 2, 3], 4));
// => [ 4, 4, 4 ]

console.log(fill([1, 2, 3], 4, 1));
// => [ 1, 4, 4 ]

From Array object:

require('array-fill/shim');

var array = [1, 2, 3];
array.fill(4, -3, -2);

console.log(array);
// => [ 4, 2, 3 ]

License

MIT © Shogo Sensui

Current Tags

  • 1.2.0                                ...           latest (10 years ago)

6 Versions

  • 1.2.0                                ...           10 years ago
  • 1.1.0                                ...           11 years ago
  • 1.0.1                                ...           12 years ago
  • 1.0.0                                ...           12 years ago
  • 0.1.0                                ...           12 years ago
  • 0.0.0                                ...           12 years ago
Maintainers (1)
Downloads
Total 16
Today 0
This Week 0
This Month 8
Last Day 0
Last Week 2
Last Month 6
Dependencies (0)
None
Dev Dependencies (1)
Dependents (1)

© 2010 - cnpmjs.org x YWFE | Home | YWFE