1.fill
例子1:数组中把3和4替换成8,
<script> let arr = [1, 2, 3, 4, 5] console.log(arr.fill(8, 2, 4)) </script>
2和4是索引(下标),从2开始到4结束
2023-10-08 13:29:52
1.fill
例子1:数组中把3和4替换成8,
<script> let arr = [1, 2, 3, 4, 5] console.log(arr.fill(8, 2, 4)) </script>
2和4是索引(下标),从2开始到4结束