填充数组空值,取前后值得中间数。
数组
Optional
保留小数位
arrayFill([1, undefined, 3, undefined, 4]); /// [1, 2, 3, 3.5, 4]arrayFill([1, undefined, 3, undefined, 4], 0); /// [1, 2, 3, 4, 4]arrayFill([1, undefined, 3, undefined, 10.55], 2); /// [1, 2, 3, 6.78, 10.55] Copy
arrayFill([1, undefined, 3, undefined, 4]); /// [1, 2, 3, 3.5, 4]arrayFill([1, undefined, 3, undefined, 4], 0); /// [1, 2, 3, 4, 4]arrayFill([1, undefined, 3, undefined, 10.55], 2); /// [1, 2, 3, 6.78, 10.55]
填充数组空值,取前后值得中间数。