{"size": 442, "ext": "js", "max_stars_repo_path": "Section-03-ES6 for React JS/ES6-Learning Series/Understanding ES6/weaksets.js", "max_stars_repo_name": "tkssharma/Reactcast", "max_stars_repo_stars_event_min_datetime": "2016-05-31T04:11:35.000Z", "max_stars_repo_stars_event_max_datetime": "2018-05-02T13:44:50.000Z", "max_issues_repo_path": "Section-03-ES6 for React JS/ES6-Learning Series/Understanding ES6/weaksets.js", "max_issues_repo_name": "tkssharma/Reactcast", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "Section-03-ES6 for React JS/ES6-Learning Series/Understanding ES6/weaksets.js", "max_forks_repo_name": "tkssharma/Reactcast", "max_forks_repo_forks_event_min_datetime": "2016-04-25T14:11:59.000Z", "max_forks_repo_forks_event_max_datetime": "2021-06-14T13:05:57.000Z"}
{"max_stars_count": 13, "max_issues_count": null, "max_forks_count": 17, "avg_line_length": 21.0476190476, "max_line_length": 78, "alphanum_fraction": 0.6809954751}
/**
  * WeakSet are collection of objects. It allows to store weakly held objects 
  * in collection. Weakly held objects are unique across collection.
  * Unlike Set, WeakSet can only store Objects. Objects are held weakly and no
  * reference is stored and hence prevents leaking.
  */

var x = {};
var y = function(){};

var ws = new WeakSet();

ws.add(x);
ws.add(y);

ws.has(x); // true

ws.delete(x);

ws.clear(); // purge whole weakset
