【发布时间】:2013-01-11 19:55:10
【问题描述】:
我有这个对象数组
var ArrTdsObjects = [];
function TdMaster(id, HeaderTxt, CurrentIndex, SortOrder, Width, Color, BgColor) {
this.id = id;
this.HeaderTxt = HeaderTxt;
this.CurrentIndex = CurrentIndex;
this.SortOrder = SortOrder;
this.Width = Width;
this.Color = Color;
this.BgColor = BgColor;
}
ArrTdsObjects.push(new TdMaster(
CurTdID,
CurTdInnerTxt,
CurTdCellindex,
CurTdSortOrder,
CurTdWidth,
"color", "bgColor"
)
);
在数组中添加了一些对象条目之后
我想根据curTdID 消除存储在ArrTdsObjects 中的重复对象
含义:数组中第一个具有相同Id的单元格将被省略,如果更高的单元格编号具有id
如果它们存在于较高的单元格编号中,我如何消除较低索引编号的数组项 意味着数组中最后添加的项目将被保存?
【问题讨论】:
标签: javascript asp.net arrays javascript-objects arrayobject