Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ In Unicode-unaware mode, this syntax causes the `-` to become a literal characte
// Remove the hyphen so the two bounds represent two alternatives
/[\p{L}\p{N}]/u;
// Use -- in unicodeSets mode, which represents set subtraction
/[[A-z]--_]]/v;
/[[A-z]--_]/v;
```

## See also
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ SyntaxError: Invalid regular expression: unrecognized character after (? (Safari
```js example-good
/Hello(\?|!)/;
// This is JavaScript syntax for character set operations
/[\p{Thai}&&\p{Digit}]/v;
/[\p{Script=Thai}&&\p{Nd}]/v;
```

## See also
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ In mathematical notation, _union_ is defined as:

And using Venn diagram:

![A Venn diagram where two circles overlap. The symmetric difference of A and B is the region contained by either or both circles.](diagram.svg)
![A Venn diagram where two circles overlap. The union of A and B is the region contained by either or both circles.](diagram.svg)

`union()` accepts [set-like](/en-US/docs/Web/JavaScript/Reference/Global_Objects/Set#set-like_objects) objects as the `other` parameter. It requires {{jsxref("this")}} to be an actual {{jsxref("Set")}} instance, because it directly retrieves the underlying data stored in `this` without invoking any user code. Then, it iterates over `other` by calling its `keys()` method, and constructs a new set with all elements in `this`, followed by all elements in `other` that are not present in `this`.

Expand Down
Loading
Loading