Best way to deallocate an array of array in javascript

Posted by andre.dias on Stack Overflow See other posts from Stack Overflow or by andre.dias
Published on 2010-06-08T17:13:18Z Indexed on 2010/06/08 17:52 UTC
Read the original article Hit count: 237

Filed under:

What is the best way to deallocate an array of array in javascript to make sure no memory leaks will happen?

var foo = new Array();
foo[0] = new Array();
foo[0][0] = 'bar0';
foo[0][1] = 'bar1';
foo[1] = new Array();
...
  1. delete(foo)?
  2. iterate through foo, delete(foo[index]) and delete(foo)?
  3. 1 and 2 give me the same result?
  4. none?

© Stack Overflow or respective owner

Related posts about JavaScript