I have the following array in JavaScript which is used to create a list of fixtures for teams to play against each other.
[["a", "b", "c", "d"], ["a", "c", "b", "d"], ["a", "d", "b", "c"]]
My current code:
var f = "";
for (var z=0; z<matches.length; z++)
{
f += "Fixture " + (z + 1 ) + " " + matches[z] + "<br/>";
}
document.getElementById("ln").innerHTML = f;
}
this outputs the array as:
Fixture 1 a,b,c,d
Fixture 2 a,c,b,d
Fixture 3 a,d,b,c
However I would like it to look like:
Fixture 1
a V b
c V d
Fixture 2
a V c
b V d
Basically I need to add a 'V' every second value after the first, and add an additional < br/ > after every 2 values.
Could someone help me out with this or point me in the right direction, please?