How to judge whether parentId already exists, if not, do not continue to add
var markNumber = []; // 全局 变量
var lastChildrenParent = parentId (sonId) .id;
if (markNumber.includes (lastChildrenParent)) {
return;
} else {
markNumber.push (lastChildrenParent)
}
console.log (lastChildrenParent);
Two: How to combine markBtn into one, including firstTop and lastTop at the same time, now they are separated twice and looped twice, just want to loop once
Solution: save the first value to the array, and then execute it again for the last time