Here I create a function within a function & give a global array a reference to the inner function. This is done on an interval to see what happens to the browser's memory usage.
The following links start intervals, you should refresh the page before running another.
Watch the memory usage of the browser while the test runs, then stop the test and release references. Or perhaps just hit refresh and see if the browser cleans up after itself.