After playing around with the join()
and slice()
functions for hours, I have just found that you can't use either function on complex arrays. So I've come to get some help here.
I'm trying to get my data below:
var data = [
["North", "Tennis",37, 25, 11, 9, 42, 13],
["East", "Football", 41, 2, 3, 26, 47, 21],
["South", "Rugby", 7, 22, 35, 45, 11, 46],
["West", "Rugby", 30, 21, 44, 23, 4, 47],
["North East", "Football", 35, 27, 12, 39, 34, 13],
["North West", "Football", 23, 4, 41, 35, 9, 47]
];
To look like this (output):
var result = [
["North: Tennis", 37, 25, 11, 9, 42, 13],
["East: Football", 41, 2, 3, 26, 47, 21],
["South: Rugby", 7, 22, 35, 45, 11, 46],
["West: Rugby", 30, 21, 44, 23, 4, 47],
["North East: Football", 35, 27, 12, 39, 34, 13],
["North West: Football", 23, 4, 41, 35, 9, 47]
];
Any help would be appreciated