我需要通过其索引值删除数组的元素。我已经有了索引值,只需要拼接即可。 customSeriesIndexMatch是我需要从customSeriesSums.data中删除的索引号
fiddle
var dataPointSum = 101100;
console.log(customSeriesSums[0].data);
// loop through customSeriesSums and match with dataPointSum
var index = customSeriesSums[0].data.indexOf(dataPointSum);
var customSeriesIndexMatch = index + 1
console.log("DataPointSum : " + dataPointSum + " " + "Matched with customSeriesSum Index : " + customSeriesIndexMatch);
// now I need to remove the customSeriesSums.data array by its index that equals customSeriesIndexMatch
最佳答案
检出splice docs。customSeriesSums[0].data.splice( customSeriesIndexMatch,1 );