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