Array.prototype.myFill = function (initValue, start = 0, end) {
end = end < 0 ? this.length + end : end;
for (let i = start; i < end; i++) {
this[i] = initValue;
}
return this;
};
let arr = [3, 3, 21, 3, 14, 12, 4, 1, 2];
console.log(arr.fill(1, 3, 5));