var employee =
{
Column1: null,
Column2: null,
create: function () {
var obj = new Object();
obj.Column1 = "";
obj.Column2 = "";
return obj;
}
};
在 C# 中,我会做这样的事情:
List<Employee> employees = new List<Employee>();
for (int i = 0; i < 10; i++)
{
Employee emp = new Employee()
{
Column1 = "column 1 of emp" + i;
Column2 = "column 2 of emp" + i;
}
employees.Add(emp);
}
我需要在javascript中做同样的事情。