I am deleting an element from an array using delete
I ave this object:
obj = {
Variables: [ {
Name: "test",
Type: "Int",
Control: "U",
Value: "123"
}, {
Name: "ftr",
Type: "DateTime",
Control: "UA",
Value: "123123"
}, {
Name: "wertwe",
Type: "Int",
Control: "SA",
Value: "435345"
} ]
};
using this code:
delete data["Variables"][2];
Now obj contains the value:
{"Variables":[{"Name":"test","Type":"Int","Control":"U","Value":"123"},{"Name":"ftr","Type":"DateTime","Control":"UA","Value":"123123"},null]}
Is there any way to delete an element without a null value appearing in the object?