js 递归遍历树形
2021-03-30 07:26
标签:child ret get div length -- function highlight children js 递归遍历树形 标签:child ret get div length -- function highlight children 原文地址:https://www.cnblogs.com/wangyunhui/p/12599016.html const getItem = function (tree, ID) {
var Deep, T, F;
for (F = tree.length; F;) {
T = tree[--F]
if (ID == T.id) return T;
if (T.children) {
Deep = getDepById(T.children, ID)
if (Deep) return Deep
}
}
}