@extra-array/fill.min

Fills with given value.

Downloads in past

Stats

StarsIssuesVersionUpdatedCreatedSize
@extra-array/fill.min
1402.10.197 months ago3 years agoMinified + gzip package size for @extra-array/fill.min in KB

Readme

Fills with given value. :package: :smileycat: :running: :vhs: :moon: :scroll: :newspaper: :bluebook:
Alternatives: fill, fill$.

This is part of package extra-array.

This is browserified, minified version of @extra-array/fill.
It is exported as global variable arrayfill.
CDN: unpkg
, jsDelivr.



array.fill(x, v, [i], [I]);
// x: an array
// v: value
// i: start index (0)
// I: end index (X)

const array = require("extra-array");

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

array.fill(x, 2, 1);
// [ 1, 2, 2, 2 ]

array.fill(x, 2, 1, 3);
// [ 1, 2, 2, 4 ]



References