Returns a set that is the difference between the set calling
difference() and the set passed to difference().
That is, returns a set containing the elements in the
comparison set that are not in the specified set.
If the sets are identical, returns an empty set (size() == 0).
Returns
non-null rules.Set difference set containing the elements found in the
comparison set that are not gound in the calling set.
Returns a set that is the intersection between the set calling
intersection() and the set passed to
intersection(). That is, returns a set containing the elements
the sets have in common.
If the sets have no elements in common, returns an empty set
(size() == 0).
Returns
non-null rules.Set intersection set containing the elements found in both
the calling set and the comparison set.
Returns a set that is the union of the set calling union() and
the set passed to union(). That is, returns a set that contains
all elements from both sets.
Returns
non-null rules.Set union set containing all of the elements in both the
calling set and comparison set.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2022-11-14 UTC."],[],[],null,["# Interface: Set\n\n[rules](/docs/reference/rules/rules).Set\n========================================\n\ninterface static\n\nSet type.\n\nA set is an unordered collection. A set cannot contain duplicate items.\n\nThere is no set literal for use in creating sets. Instead, create sets from\nlists using `List.toSet()`. See [rules.List](/docs/reference/rules/rules.List). \n\n```scilab\n// Create a set and check its size\n['a','b'].toSet().size() == 2\n```\n\nIn addition to the methods listed below, sets have the following operators:\n\n*** ** * ** ***\n\n| Operator | Usage |\n|----------|---------------------------------------------------------------------------------------------|\n| `x == y` | Compare sets x and y |\n| `v in x` | Check if value v exists in set x. For example: ```text 'a' in ['a','b'].toSet() == true ``` |\n\nMethods\n-------\n\n### difference\n\ndifference() returns [rules.Set](/docs/reference/rules/rules.Set)\n\nReturns a set that is the difference between the set calling\n`difference()` and the set passed to `difference()`.\nThat is, returns a set containing the elements in the\ncomparison set that are not in the specified set.\n\nIf the sets are identical, returns an empty set (`size() == 0`).\n\nReturns\n\n: `non-null `[rules.Set](/docs/reference/rules/rules.Set) difference set containing the elements found in the\n comparison set that are not gound in the calling set.\n\n#### Example\n\n ['a','b'].toSet().difference(['a','c'].toSet()) == ['b'].toSet()\n\n### hasAll\n\nhasAll() returns [rules.Boolean](/docs/reference/rules/rules.Boolean)\n\nTest whether the set calling `hasAll()` contains all of the items\nin the comparison set passed to `hasAll()`.\n\nReturns\n\n: `non-null `[rules.Boolean](/docs/reference/rules/rules.Boolean) whether the calling set contains all the items of\n the comparison set or list.\n\n#### Example\n\n ['a','b'].toSet().hasAll(['a','c']) == false\n ['d','e','f'].toSet().hasAll(['d','e']) == true\n\n### hasAny\n\nhasAny() returns [rules.Boolean](/docs/reference/rules/rules.Boolean)\n\nTest whether the set calling `hasAny()` contains any of the items\nin the set or list passed to `hasAny()`.\n\nReturns\n\n: `non-null `[rules.Boolean](/docs/reference/rules/rules.Boolean) whether the calling set contains any of the items\n of the comparison set or list.\n\n#### Example\n\n ['a','b'].toSet().hasAny(['c','d'].toSet()) == false\n ['a','b'].toSet().hasAny(['a','c'].toSet()) == true\n\n### hasOnly\n\nhasOnly() returns [rules.Boolean](/docs/reference/rules/rules.Boolean)\n\nTest whether the set calling `hasOnly()` contains only the items\nin the comparison set or list passed to `hasOnly()`.\n\nReturns\n\n: `non-null `[rules.Boolean](/docs/reference/rules/rules.Boolean) whether the calling set contains only the items of\n the comparison set or list.\n\n#### Example\n\n ['a','b'].toSet().hasOnly(['a','c']) == false\n ['a','b'].toSet().hasOnly(['a','b']) == true\n\n### intersection\n\nintersection() returns [rules.Set](/docs/reference/rules/rules.Set)\n\nReturns a set that is the intersection between the set calling\n`intersection()` and the set passed to\n`intersection()`. That is, returns a set containing the elements\nthe sets have in common.\n\nIf the sets have no elements in common, returns an empty set\n(`size() == 0`).\n\nReturns\n\n: `non-null `[rules.Set](/docs/reference/rules/rules.Set) intersection set containing the elements found in both\n the calling set and the comparison set.\n\n#### Example\n\n ['a','b'].toSet().intersection(['a','c'].toSet()) == ['a'].toSet()\n\n### size\n\nsize() returns [rules.Integer](/docs/reference/rules/rules.Integer)\n\nReturns the size of the set.\n\nReturns\n\n: `non-null `[rules.Integer](/docs/reference/rules/rules.Integer) the number of values in the specified set.\n\n### union\n\nunion() returns [rules.Set](/docs/reference/rules/rules.Set)\n\nReturns a set that is the union of the set calling `union()` and\nthe set passed to `union()`. That is, returns a set that contains\nall elements from both sets.\n\nReturns\n\n: `non-null `[rules.Set](/docs/reference/rules/rules.Set) union set containing all of the elements in both the\n calling set and comparison set.\n\n#### Example\n\n ['a','b'].toSet().union(['a','c'].toSet()) == ['a', 'b', 'c'].toSet()"]]