'use strict';
function fill(arr, target, start, end) {
const result = [...arr];
const startIndex = start ?? 0;
const endIndex = end ?? arr.length;
for (let i = startIndex; i < endIndex; i++) {
result[i] = target;
}
return result;
}
exports.fill = fill;