Files
2025-11-28 19:45:44 -07:00

16 lines
450 B
JavaScript

'use strict';
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
function fill(array, value, start = 0, end = array.length) {
const length = array.length;
const finalStart = Math.max(start >= 0 ? start : length + start, 0);
const finalEnd = Math.min(end >= 0 ? end : length + end, length);
for (let i = finalStart; i < finalEnd; i++) {
array[i] = value;
}
return array;
}
exports.fill = fill;