@array-like/fill
v0.0.1
Published
ArrayLike filling functions for JavaScript
Downloads
88
Readme
:icecream: @array-like/fill
ArrayLike
filling functions for JavaScript.
See docs.
import {alloc} from '@array-like/alloc';
import {iota} from '@array-like/fill';
const a = alloc(100); // undefined undefined undefined ...
iota(a, 0, 100, 0);
a; // 0 1 2 3 4 ...
import {fill} from '@array-like/fill';
fill(a, 0, 100, -1);
a; // -1 -1 -1 -1 -1 ...
import {fillfn} from '@array-like/fill';
fillfn(a, 0, 100, () => []);
a; // [] [] [] [] [] ...
a[0] !== a[1]; // true