Exécuter
❯
Exécuter le code
Ctrl+Alt+R
Enregistrer le code
Ctrl+Alt+A
Changer d'orientation
Ctrl+Alt+O
Changer de thème
Ctrl+Alt+D
<!DOCTYPE html> <html> <body> <h1>JavaScript Ensembles</h1> <h2>La méthode Set.union()</h2> <p>La<b>Set.union()</b> method returns a new set containing the elements which are in this set, or in the argument set, or in both:</p> <p id="demo"></p> <script> const A = new Set(['a','b','c']); const B = new Set(['b','c','d']); const C = A.union(B); let text = ""; for (const x of C) { texte += x; } document.getElementById("demo").innerHTML = "L'union est : " + text; </script> </body> </html>