1
var MyHashSet = function () {2
// Really you should just3
// Make your own object, but instead4
// we have attached ourself to the5
// `this` object which then becomes our hashmap.6
// What you should instead do is this:8
// And then update our following functions11
MyHashSet.prototype.add = function (key) {13
// Linear Space | To the size of the input key14
// You can access objects using array notation19
MyHashSet.prototype.remove = function (key) {22
// You can access objects using array notation23
// Here we use the delete keyword.28
MyHashSet.prototype.contains = function (key) {31
// This just asks if the property exists33
return this.hasOwnProperty(key);