From acdcc135329c3aaa6bc12f818496cf13f5797611 Mon Sep 17 00:00:00 2001 From: Vitya <9317613+vitya-ne@users.noreply.github.com> Date: Fri, 12 Jul 2024 15:32:00 +0300 Subject: [PATCH] =?UTF-8?q?=D0=94=D0=BE=D0=B1=D0=B0=D0=B2=D0=BB=D1=8F?= =?UTF-8?q?=D0=B5=D1=82=20=D0=B4=D0=BE=D0=BA=D1=83=20=D0=B4=D0=BB=D1=8F=20?= =?UTF-8?q?=D0=BC=D0=B5=D1=82=D0=BE=D0=B4=D0=B0=20`Set.union()`=20(#5428)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Mikhail <30442282+loonlylokly@users.noreply.github.com> Co-authored-by: Svetlana Korobtseva --- js/set-union/images/set-union.png | Bin 0 -> 24578 bytes js/set-union/index.md | 70 ++++++++++++++++++++++++++++++ 2 files changed, 70 insertions(+) create mode 100644 js/set-union/images/set-union.png create mode 100644 js/set-union/index.md diff --git a/js/set-union/images/set-union.png b/js/set-union/images/set-union.png new file mode 100644 index 0000000000000000000000000000000000000000..f4eb1695eccd35368320939c8a105da78290e170 GIT binary patch literal 24578 zcmeFZWmwkD(>MO5yBm~FL8K%^8cyj3rKG#NLpY_oySt=QP(YMM5TsM-lvEIS7Jv8u z_#emf;(l>IZ*SgQ*Eu^oJ3G7c+1c6o8lkHE0tb^46M`TdIaz6S2*SmOAXIU5BtRiS zp-2b+iC0zBlp&{hpu^*OcXzkDdFY@34>nJI`c!az{m1#q<@b?AM@Q$LhG8{z&0oKM zF|#}}74s{Ms_Xy!xjMZ)EwH@2ydpC*tEHsZ>s3rzK-ucthJQd{c|~PZbd0q03nOFG z;SW<)>FqHtdC}3aQBg6bV!l&TQ!TA+>py;co0{T#D%jfECM6Avamj5d>1iqLt*EFx zMw8cpAj8LU(h{0p^ZPw-fTB=P{!Im01>*hx{?Go5E>^|=^&GfsCeYOSAOF1-5d>xg zeuX+Ak3;ef@Bo~Kf{a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WyL!K6Y?Bsck;&)-Q>MG;=Ff7 zR_SaK;{BJJy=Rrpcu4pp;%$)dflOLhY?#{Ce$*eX!zL{pOWv6Vt6PZb zlP4XEdzk)fSqGt6#uM?6u`yR_y++XEg?wP7mO7iV=`RmGu65pi1{4w|+zP5jgIpPu zQG>DklPfKPq88<82d1w7^@?)+Rn7X}(b(UA{VMkTcbWXhlV9Tb4`KZMr#m}1EDSD& igGe%q=s)@Bl@oo>7dVcHpuW-H>S^D;fxCV$`u_kWK-x3_ literal 0 HcmV?d00001 diff --git a/js/set-union/index.md b/js/set-union/index.md new file mode 100644 index 0000000000..09455521b8 --- /dev/null +++ b/js/set-union/index.md @@ -0,0 +1,70 @@ +--- +title: "`.union()`" +description: "Метод объединения двух коллекций, который возвращает новую коллекцию с элементами, встречающимися в одной или в обоих коллекциях." +baseline: + - group: set-methods + features: + - javascript.builtins.Set.union +authors: + - vitya-ne +related: + - js/set + - js/map + - js/array-join +tags: + - doka +--- + +## Кратко + +Метод `union()` объединяет текущую коллекцию с другой и возвращает новую, состоящую из элементов, которые есть в любой из коллекций. + +В математике это называется объединением двух множеств. Оно описывается так: объединение множеств A и B — это множество, которое состоит из элементов, находящихся в любом из множеств А и B. + +Это можно выразить формулой: + +``` +A ∪ B = { x | x ∈ A ∨ x ∈ B } +``` + +![Объединение двух множеств](images/set-union.png) + +## Пример + +В двух последних проектах инженер Фёдор использовал определённый стек технологий. При составлении CV, Фёдор решает перечислить навыки, которыми он теперь обладает. Нужно сравнить две коллекции и получить список технологий, используемых хотя бы в одном из проектов. В этом Фёдору поможет метод `union()`: + +```js +const project1 = new Set(['PHP', 'Bash', 'Docker', 'JavaScript', 'CSS']) +const project2 = new Set(['Docker', 'JavaScript', 'Bash', 'Postgres', 'MongoDB']) + +const result = project1.union(project2) + +console.log(result) +// Set(9) { +// 'PHP', +// 'Bash', +// 'Docker', +// 'JavaScript', +// 'CSS', +// 'Postgres', +// 'MongoDB' +// } + +``` + +## Как пишется + +Метод `union()` принимает один обязательный аргумент — объект, содержащий коллекцию для объединения. Если аргумент не указан, будет брошено исключение `TypeError`. + +Аргументом может быть как [`Set`-объект](/js/set/), так и `Set`-подобный объект, например, [`Map`](/js/map/). + +💡 `Set`-подобный (Set-like) объект должен иметь свойство `size` и методы `has()` и `keys()`. Обычный массив, а также [`WeakSet`]-объект(/js/weak-set/) не являются `Set`-подобными объектами, так как не обладают всеми требуемыми свойствами и методами. + +Метод `union()` возвращает новый `Set`-объект, содержащий объединение исходной и указанной коллекций. Порядок элементов будет соответствовать порядку исходной, а затем указанной коллекции. + +## Как понять + +Метод `union()` позволяет объединять две коллекции элементов без необходимости писать дополнительный код обхода и сравнения. + +Поддержка метода `union()` в основных браузерах и в [Node.js](/tools/nodejs/) появилась в 2024 году. Если попробуете использовать метод в более ранних версиях, это приведёт к ошибке. +