set.intersection
Perform an intersection of set types.
QueryLogic.set.intersection(setA, setB)
Performs an intersection of setA
and setB
and returns the
result. Will throw an error if defineComparison has
not been called with comparison operations
necessary to perform the intersection. Use intersection
to perform an intersection between two plain Query objects.
QueryLogic.set.intersection
can be used to test custom comparison types:
import {QueryLogic} from "can";
const gt3 = new QueryLogic.GreaterThan(3);
const lt6 = new QueryLogic.LessThan(6);
const intersect = QueryLogic.intersection(gt3, lt6);
console.log( intersect ); //-> new QueryLogic.ValueAnd( [
// gt3,
// lt6
// ] )
Parameters
- setA
{SetType}
:An instance of a SetType.
- setB
{SetType}
:An instance of a SetType.
Returns
{SetType}
:
An instance of a SetType.