日常问题

vscode 相同内容多选同时编辑

Crtl + Shift + L 全选

Crtl + D 加选

gitbhub 太慢?

nslookup github.global.ssl.fastly.Net

nslookup github.com

[pch@PCHdeMacBook-Pro:~]$ nslookup github.global.ssl.fastly.Net
Server:		192.168.2.1
Address:	192.168.2.1#53

Non-authoritative answer:
Name:	github.global.ssl.fastly.Net
Address: 107.181.166.244

[pch@PCHdeMacBook-Pro:~]$ nslookup github.com
Server:		192.168.2.1
Address:	192.168.2.1#53

Non-authoritative answer:
Name:	github.com
Address: 13.229.188.59
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15

hosts 添加

151.101.76.249 http://global-ssl.fastly.net
192.30.255.113 http://github.com
1
2

npm 上下架包

npm publish
npm --force unpublish pkg
1
2

String.prototype.padStart()

ES6 padStart() 方法用另一个字符串填充当前字符串(如果需要的话,会重复多次),以便产生的字符串达到给定的长度。从当前字符串的左侧开始填充。

扩展:String.prototype.padEnd()

"abc".padStart(10); // "       abc"
"abc".padStart(10, "foo"); // "foofoofabc"
"abc".padStart(6, "123465"); // "123abc"
"abc".padStart(8, "0"); // "00000abc"
"abc".padStart(1); // "abc"
1
2
3
4
5

forin 的副作用

var arr = [1, 2]; // arr 是实例,咩有 prototype ,但有[[prototype]] (也就是__proto__)
arr.__proto__.age = 33;
for (let key in arr) {
    console.log(arr[key], key);
}
/*
1 0
2 1
33 age
*/
1
2
3
4
5
6
7
8
9
10