yatter
    Preparing search index...

    Function intersect

    • 计算数组的交集,可以传多个数组,最后一个参数可以是包括 key 方法的对象,key 方法用来唯一标识一个元素

      Type Parameters

      • T

      Parameters

      • ...args: CollAgrs<T>

      Returns T[]

      intersect([{id: 34}], [{id: 34}])  // []
      intersect([{id: 34}], [{id: 34}], {key: a => a.id}) // [{id: 34}]