<!DOCTYPE html>
<html>

  <head>
    <link rel="stylesheet" href="style.css">
    <script src="script.js"></script>
  </head>

  <body>
    <h1>Open the JS console and see script.js</h1>
  </body>

</html>
console.clear();

const wset = new WeakSet();

// top level static var, should show up in `wset`
let arr = [1];
wset.add(arr);

function test() {
  let obj = {a:1}; //stack var, should get GCed
  wset.add(obj);
}

test();

//if we wanted to get rid of `arr` in `wset`, we could explicitly de-reference it
//arr = null;

// when run with devtools console open, this always holds onto `obj`
// when it's closed when run, then opened after, `wset` has the `arr` entry
// but not the `obj entry, as expected
console.log(wset);
/* Styles go here */