This JavaScript being an Array of objects is directly transferable to C#, and you have multiple ways to do it and multiple collection classes to use (unlike JavaScript which only has one collection class)
It can almost be written verbatim in C# and is perfectly valid (Using Anonymous Types):
var players = new [] {
new {name = "Joe",score = 25, color = "red", attribs = new int[]{ 0,1,2,3,4}},
new {name = "Jenny",score = 1, color = "black", attribs = new int[]{4,3,2,1,0}}
};
But I'm not sure if this is going to achieve what you want (Functionality wise)
IMO creating a typed object would be a better approach (I would consider this to be a better approach in both C# and JavaScript), so I would approach it more like this (JavaScript):
function Player(name,score,color,attribs)
{
this.name = name;
this.score = score;
this.color = color;
this.attribs = attribs;
}
var players = [
new Player("Joe", 25, "red", [0, 1, 2, 3, 4]),
new Player("Jenny",1,"black", [4, 3, 2, 1, 0])
];
and the same thing in C#:
public class Player
{
public string name;
public int score;
public string color;
public int[] attribs;
}
Player[] players = new Player[]{
new Player(){ name = "Joe", score = 25, color = "red", attribs = new int[]{0,1,2,3,4} },
new Player(){ name = "Jenny", score = 1, color = "black", attribs = new int[]{4,3,2,1,0} },
};
or to get a lot more flexibility you can use them in a List like:
List<Player> players = new List<Player>(){
new Player(){ name = "Joe", score = 25, color = "red", attribs = new int[]{0,1,2,3,4} },
new Player(){ name = "Jenny", score = 1, color = "black", attribs = new int[]{4,3,2,1,0} },
};