How to delete new'd arrays in JavaScript? -


i'm using unity, technically unityscript assume built-in arrays work same way. have array create thusly:

var room:roominfo[,,]; room=new roominfo[5,5,5]; 

what's deleting syntax? doing delete room; or delete room[,,]; doesn't seem work. after deleting need this:

room=new roominfo[10,10,10]; 

seems ridiculously simple question confused these things , forget, , couldn't find on google (because couldn't work out search).

you don't need it, unityscript (automatic memory management). if still prefer own way do, use this:

room = null; 

and after this, can initialise to:

room = new roominfo[10,10,10]; 

so full code be:

room = null; room = new roominfo[10,10,10]; 

Comments

Popular posts from this blog

angularjs - ADAL JS Angular- WebAPI add a new role claim to the token -

php - CakePHP HttpSockets send array of paramms -

node.js - Using Node without global install -