Allen
Allen
> ```js > function myInstanceof(left, right) { > if (!left) return false; > return ( > left.__proto__ === right.prototype || myInstanceof(left.__proto__, right) > ); > } > function Person() {...
``` function list2tree(arr) { const getChildren = (id, arr) => { let children = []; for (const node of arr) { // node is child if (node.pid === id) {...
```javascript Promise.myAll = function (iterObj) { //1. 检查arr是否是可迭代的对象 if ( !( typeof iterObj === "object" && iterObj !== null && typeof iterObj[Symbol.iterator] === "function" ) ) { throw new Error(`${iterObj}...