code: function(obj) {
      var key = JSON.stringify(obj);
      if (!(key in this.map)) {
        this.map[key] = this.unique.length;
        this.unique.push(obj);
      }
      return this.map[key];
    }
docs: ### .add(v)  Adds the object `obj` to `unique` if it hasn't already been added. Returns the index of `obj` in `unique`.