Hello, My Chinese name is “张宝”. I am a front-end development programmer (more than 6 years of experience)from Shanghai, China. I usually write in Chinese.
I am active in many Chinese communities, such as juejin(掘金), Yuque(语雀) and bilibili(B站).
Here is a list of what I publish on these platforms:
.then 方法的 Promise 对象pending 状态 then 回调函数的收集和异步调用功能(借助更精确的 queueMicrotask 而非 setTimeout).then 方法返回一个 Promise 对象的功能**)
** 等价于 Math.pow()Array.prototype.includes()
.indexOf() 不同之处在于 [NaN].includes(NaN) 判定结果为 trueclass X {} 的 ES5 解释
class X extends P {} 的 ES5 解释
X.prototype 的原型对象设置成 P.prototypeX 的原型对象设置成 PP 构造函数逻辑X 构造函数逻辑util.promisify() 函数
callback 回调参数stack + runner(0))useEffect 中的竞态条件问题
ignore,一个是 AbortController 的 .abort() 方法ref(val) 本质上就是 reactive({ value: val }),为了方便,我们应该地盲目地选择 ref() 而不是 reactive()// 获取一个对象上所有的属性键。Symbol 和字符串,枚举和不可枚举
function getOwn(obj) {
return Object.getOwnPropertyNames(obj).concat(Object.getOwnPropertySymbols(obj))
}
// 判定一个对象上是否包含指定属性键
Object.hasOwn(obj, propKey)