网页学习体会

  • 首页
  • 个人博客
您的位置: 首页  >  IT文章  >  jquery 数组求差集,并集

jquery 数组求差集,并集

分类: IT文章 • 2023-10-28 14:03:41

var alpha = [1, 2, 3, 4, 5, 6],
beta = [4, 5, 6, 7, 8, 9];

$.arrayIntersect = function(a, b)
{
return $.merge($.grep(a, function(i)
{
return $.inArray(i, b) == -1;
}) , $.grep(b, function(i)
{
return $.inArray(i, a) == -1;
})
);
};

window.console && console.log( $.arrayIntersect(alpha, beta) );

相关推荐

  • 并查集
  • quick_fond算法, quick_union算法, weighted_quick_union算法, weighted_quick_union_with_path_comperession算法, 森林,并查集,朋友圈问题
  • c# 时间区间求并集
  • js 获取两个数组的交集,并集,补集,差集
  • 两个结果集进行并集操作
  • poj 1182--食物链 (并查集)
  • Linux shell 计算两个文件的并集、交集、差集  假设我们现在有两个文件 a.txt 、b.txt
  • [Gym-102346A] 偷偷偷 并查集处理图(坐标)
  • poj 2492 A Bug's Life(种类并查集)
  • day21 TFRecord格式转换MNIST并显示 TFRecord和Protobuf协议简介 利用TFRecord格式存储、读取和现实MNIST数据集
  • 模糊匹配中,精确匹配排在前面
  • 接口类和抽象类
    网站免责声明 网站地图 最新文章 用户隐私 版权申明
本站所有数据收集于网络,如果侵犯到您的权益,请联系网站进行下架处理。   

Copyright © 2018-2021   Powered By 网页学习体会    备案号:   粤ICP备20002247号