intersect

2018-11-18 admin

intersect是什么

什么是intersect,Find the intersection of two arrays

intersect使用教程帮助文档

intersect

build status downloads

browser support

Usage

var intersect = require('intersect');

var a = ['foo', 'bar', 'baz'];
var b = ['nope', 'bar', 'baz'];

console.log(intersect(a, b));
// => ['bar', 'baz']

Installation

With npm do

$ npm install intersect

With component do

$ component install juliangruber/intersect

API

intersect(a, b)

Find the intersection of arrays a and b. The individual arrays are expected to be sets, i.e. there’s no duplicate elements in them.

intersect(arrays)

You can also pass an array of arrays as a single argument, to get the intersection of n arrays.

intersect.big(a, b)

This module contains an alternative intersection algorithm by @minuteman3, better suited for intersecting big arrays.

The implementations might compare like this, depending on your host environment:

graph of intersect

License

(MIT)

Copyright © 2013 Julian Gruber <julian@juliangruber.com>

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

本站文章除注明转载外,均为本站原创或编译。欢迎任何形式的转载,但请务必注明出处。

转载请注明:文章转载自 JavaScript中文网 [https://www.javascriptcn.com]

本文地址:https://www.javascriptcn.com/read-45771.html

文章标题:intersect

相关文章
原生实现img-lazyLoad:图片延迟加载(基于intersection Observer)
intersection Observer简介 点击查阅MDN关于此api的使用说明 这个api是用来检测dom元素交集的,常见的应用场景之一就是本文提到的对图片进行懒加载,即:拖动窗口滚动条,到达当前这个图片的时候,再去读取挂在自定义属性...
2019-01-31
lodash.intersectionwith
lodash.intersectionwith是什么 什么是lodash.intersectionwith,The lodash method _.intersectionWith exported as a module. lodash...
2019-03-25
lodash.intersectionby
lodash.intersectionby是什么 什么是lodash.intersectionby,The lodash method _.intersectionBy exported as a module. lodash.inter...
2019-03-25
ray-triangle-intersection
ray-triangle-intersection是什么 什么是ray-triangle-intersection,intersect a ray and triangle in 3 dimensions ray-triangle-int...
2019-04-20
ray-plane-intersection
ray-plane-intersection是什么 什么是ray-plane-intersection,whether a picking ray intersects with a plane ray-plane-intersectio...
2019-04-20
ray-sphere-intersection
ray-sphere-intersection是什么 什么是ray-sphere-intersection,test whether a ray intersects with a sphere ray-sphere-intersecti...
2019-04-20
ray-aabb-intersection
ray-aabb-intersection是什么 什么是ray-aabb-intersection,Determine the point of intersection between a ray and axis-aligned bou...
2019-04-20
回到顶部