<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>javascript</title>
</head>
<body>
<script>
let team = ["tom","mike","jane"];
let pairs = [];
for (let i=0;i<team.length;i++){
for(let j=0;j<team.length;j++){
if(team[i] !== team[j]){
pairs.push([team[i],team[j]]);
}
}
}
console.log(pairs.join("--"));
let team2 = ["tom","mike","jane"];
let pairs2 = [];
for (let a of team2){
for (let b of team2){
if(a !== b){
pairs2.push([a,b]);
}
}
}
console.log(pairs2.join(".."));
</script>
</body>
</html>