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 intersection()</h2> <p>The intersection() method returns a new set containing the elements which are in this set and in the argument set:</p> <p id="demo"></p> <script> const A = new Set(['a','b','c']); const B = new Set(['b','c','d']); const C = A.intersection(B); let text = ""; for (const x of C) { texte += x; } document.getElementById("demo").innerHTML = "L'intersection est : " + text; </script> </body> </html>