Array.prototype.with和arr下标赋值性能对比

33 阅读1分钟

Array.prototype.with(i,0) VS arr[i]=0 性能对比:

话不多说,直接上代码:

可以观察到直接赋值的效率更高:

image.png