I tried setting the scriptobject to a global variable and doing deleteVariables("$scriptobject.array*"); , but it seems the variables are still there when i dump the object.Is there a way around this?
Probably not, just take 5 minutes and write the function yourself.
Setting them to "" won't remove them.