How do set array x to empty ?
var testObj = {
x : ['1', '2'],
y : ['1' , '3']
}
To Replace
var testObj = {
x : [],
y : ['1' , '3']
}
How do set array x to empty ?
var testObj = {
x : ['1', '2'],
y : ['1' , '3']
}
To Replace
var testObj = {
x : [],
y : ['1' , '3']
}
If you don't want to reassign the variable, you can also
testObj.x.length = 0;