![](https://img-blog.csdnimg.cn/20201014180756757.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
js
valueflow
记录学习过程。
展开
-
js ??和?.的含义
??(空值合并操作符) 当左侧值为 null 或 undefined 时,返回 ?? 符号右边的值 案例如下: 'hello world' ?? 'hi' // 'hello world' '' ?? 'hi' // '' false ?? 'hi' // false null ?? 'hi' // 'hi' undefined ?? 'hi' // 'hi' ?.(可选链操作符) 允许读取位于连接对象链深处的属性的值,而不必明确验证链中的每个引用是否有效。 案例如下: let ne原创 2021-06-17 14:19:53 · 33298 阅读 · 1 评论 -
npm更换镜像源以及注意事项
// 打开终端 npm install -g cnpm --registry=https://registry.npm.taobao.org // 更换镜像源 npm config set registry https://registry.npm.taobao.org // 验证是否成功 npm config get registry 解决部分前端工具无法下载的问题。 注意事项 1.更换镜像源后 vsCode登录会出现 “npm login error 500”报错 解决办法: // 更换回原来的镜原创 2021-06-16 14:37:40 · 368 阅读 · 0 评论