3

For example:

var test = [1,2,3,4,5];
test.length = 0;

Is this a good way to release memory of variable test?

Lee Taylor
  • 7,761
  • 16
  • 33
  • 49
ZHENG Wen
  • 31
  • 2

1 Answers1

2

No don't worry about that, that just makes your code longer. Keep your variable in the tightest of scope, and if not needed anymore, it should get handled by the garbage collection system.

dchhetri
  • 6,926
  • 4
  • 43
  • 56