楚江
Results
2
comments of
楚江
> 另外我感觉Set应该用Map实现比较好吧 使用map的话,js的对象在遍历时是无序的,Set的规范里要求要按add的顺序来遍历
``` const arr = [1, 2, [3, 4, [5, 6]]] Array.prototype._flat = function (depth = Infinity) { --depth return this.reduce((prev, curr) => { if(Array.isArray(curr) && depth >= 0) { prev...