How can I remove an object from an array?
I wish to remove the object that includes name Kristian from someArray. For example:
som
If you wanna access and remove object of an array simply you can try something like this.
// inside some function
let someArray = [ {"ColumnName" : "a", "PropertySerno" : 100005,"UpdateType" : 1},
{"ColumnName" : "b", "PropertySerno" : 100202,"UpdateType" : 1,
"ShowRemoveButton" : true} ];
for (let item of someArray) {
delete item.ShowRemoveButton;
}
console.log(item.outputMappingData.Data);
//output will be like that = [ {"ColumnName" : "a", "PropertySerno" : 100005,"UpdateType" : 1},
// {"ColumnName" : "b", "PropertySerno" : 100202,"UpdateType" : 1 }];