this.add = function(value) {
if(!this.has(value)){
items[value]=value;
return true;
}
return false;
}
for this line of code: items [value] = value
, the book says: when you add a value, save it as both a key and a value, which helps to find the value .
< H2 > question: how does it help to find this value in this way? Is it advantageous to use the value to find the value? What"s wrong with passing a button? < / H2 >