0.0.0 • Published 8 years ago

a-fill v0.0.0

Weekly downloads
10
License
MIT
Repository
-
Last release
8 years ago

a-fill Build Status

Fills elements of array with value

Install

$ npm install --save a-fill

Example

var fill = require('a-fill');
console.log(fill([1, 2, 3, 4, 5], 10));
// - > [10, 10, 10, 10, 10]

console.log(fill([1, 2, 3, 4, 5], '*', -2, 4));
// -> [1, 2, 3, 10, 5]

require('a-fill')(array, value, [start=0], [end=array.length])

Arguments:

  • array: An array that to be filled
  • value: The value to fill array with
  • [start=0] (number): The start position. It can be negative
  • [end=array.length] (number): The end position. It can be negative

Returns: Returns a array with filled value

License

© 2016 Vikram Jadhav. MIT License

0.0.0

8 years ago