== will loosely judge the null value ' ' and the value 0 as equal, and js will step on the pit record

当sign=' ',i.parentId = 0

I wrote a judgment condition

if(sign==i.parentId)

It was found that passed,

I looked at the knowledge points and said that == is loosely equal, you can use ===strictly equal

Pay attention when writing code in the future

Guess you like

Origin blog.csdn.net/gjylalaland/article/details/129091914