删除依赖包(node_moudles)
在对应目录中打开git bash 执行 rm -rf ./node_modules
Array.prototype.fill()
fill()
方法用一个固定值填充一个数组中从起始索引(默认为 0
)到终止索引(默认为 array.length
)内的全部元素。它返回修改后的数组。
const array1 = [1, 2, 3, 4];
// Fill with 0 from position 2 until position 4
console.log(array1.fill(0, 2, 4));
// Expected output: Array [1, 2, 0, 0]
// Fill with 5 from position 1
console.log(array1.fill(5, 1));
// Expected output: Array [1, 5, 5, 5]
console.log(array1.fill(6));
// Expected output: Array [6, 6, 6, 6]
冷知识
Array.prototype 也是一个数组
Array.isArray(Array.prototype);
淘宝镜像切换
淘宝原镜像域名(registry.npm.taobao.org
)的 HTTPS 证书正式到期。
如果你是将npm官方镜像改成了淘宝镜像,并想要继续使用,需要将 npm 源切换到新的源(registry.npmmirror.com
),否则会报错。