可可 2022-05-04 13:55:04
http1.0不支持持久连接
http1.1支持持久连接,但是串行发送请求,并行请求只能同时建立多个tcp连接,引入了管道化,但是存在队头阻塞的问题
http2.0二进制分帧、多路复用、头部压缩、服务端推送
可可 2022-05-04 13:54:12
为啥感觉你们写的怎么这么复杂 。。。
Promise.retry = function (promiseFunc, num = 2) { return promiseFunc().then(null, (e) => { if (num > 0) { num -= 1; console.log("重试"); return Promise.retry(promiseFunc, num); } return Promise.reject(e); }); };
再简化一下
Promise.retry = function (promiseFunc, num = 2) { return promiseFunc().then(null, (e) => num > 0 ? Promise.retry(promiseFunc, num - 1) : Promise.reject(e)); };
- 共 1 页
- 1
规范
15.4.4.7 Array.prototype.push ( [ item1 [ , item2 [ , … ] ] ] )
The arguments are appended to the end of the array, in the order in which they appear. The new length of the array is returned as the result of the call.
When the push method is called with zero or more arguments item1, item2, etc., the following steps are taken:
Increase n by 1.
Return n.
NOTE The push function is intentionally generic; it does not require that its this value be an Array object. Therefore it can be transferred to other kinds of objects for use as a method. Whether the push function can be applied successfully to a host object is implementation-dependent.
第七步是原因
第 46 题:输出以下代码执行的结果并解释为什么?