hesen

Results 4 comments of hesen

![image](https://user-images.githubusercontent.com/26702657/115847586-b1f91a80-a455-11eb-85da-fcc53e7c4353.png) 如果加了 prettier 配置的话, 这里的代码格式错误是会提示, 但是eslint 是没有错误的.

![image](https://user-images.githubusercontent.com/26702657/223600565-d2f263e6-a796-4848-9fee-1f00cff82a6c.png) ![image](https://user-images.githubusercontent.com/26702657/223600600-f96c3271-1b69-4d5a-8c90-f24897c590cb.png)

> > if (item.nodeType === 1) { > > //递归先序遍历子节点 > > traversal(item); > > } > > 这里的判断可以省略吧,毕竟递归之后又会重新判断 > > 不是元素节点的话没必要往后走了,这个判断还是要的 那是不是应该加一个console.log输出, 是不是就跟上面的console.log输出重复了?

> ``` > function traversal(node) { > const stack = []; > stack.push(node); > while(stack.length > 0) { > const elem = stack.pop(); > if (elem && elem.nodeType === 1)...