摘要:
一、Set 是什么(一句话) Set 是一个只允许“唯一值”的集合,常用于去重和快速查找。 二、创建 Set 1️⃣ 空 Set const s = new Set(); 2️⃣ 由数组创建(最常见) const s = new Set([1, 2, 2, 3]); // Set { 1, 2, 3 阅读全文
摘要:
export function isObjectInHierarchy(child, parent) { if (!child || !parent) return false; let o = child; while (o) { if (o parent) return true; o = o. 阅读全文