Function reference · Assumptions and sets
intersection
Returns the set of values that are in every one of the given sets.
Notation
intersection(set1, set2[, ...])
Write it in an expression: nerdamer('intersection({1,2,3},{2,3,4})'), or in the Playground.
nerdamer.intersection
nerdamer.intersection(...args: string | number | bigint | ParserEntity[]): ParserEntity
A method on the default import. Arguments can be strings, as in Notation.
import { intersection }
import { intersection } from 'nerdamer/structures';
intersection(...sets: ParserEntity[]): ParserEntity
Import only this function, from nerdamer/structures.
Parameters
set1, set2, ...- Two or more sets, written
{...}.
Returns
A set, empty, {}, when no value is in all of them.
Examples
Good to know
- Every argument must be a set.
JavaScript examples
nerdamer.intersection('{1,2}', '{2,3}').text()
// → {2}