>>> o == o
true
>>> p == o
false

FWIW, here's the definition of the function getProperties, which is used by the tag function.  Criticisms welcome.  (WARNING: I'm a completely clueless JS noob who doesn't know what he's doing!  Use this function at your own risk!)
function getProperties(o) {
  var seen = {};
  function _properties(obj) {
    var ret = [];
    if (obj === null) {
      return ret;
    }
    try {
      var ps = Object.getOwnPropertyNames(obj);
    }
    catch (e if e instanceof TypeError &&
                e.message === "obj is not an object") {
      return _properties(obj.constructor);
    }
    for (var i = 0; i < ps.length; ++i) {
      if (typeof seen[ps[i]] === "undefined") {
        ret.push(ps[i]);
        seen[ps[i]] = true;
      }
    }
    return ret.concat(_properties(Object.getPrototypeOf(obj)));
  }
  return _properties(o);
}

A:

I think you're overcomplicating all of this. There's no reason you need to store the tag on the object itself. If you create a separate object that uses the object's pointer as a key, not only will you conserve space, but you'll prevent any unintentional collisions should the arbitrary object happen to have a property named "_tagged".
var __tagged = {};

function tag(obj){
    __tagged[obj] = true;
    return obj;
}

function isTagged(obj){
    return __tagged.hasOwnProperty(obj);
}

function getTagged(obj){
    if(isTagged(obj)) return obj;
}

== EDIT ==
So I decided to take a minute to create a more robust tagging system. This is what I've created.
var tag = {
    _tagged: {},

    add: function(obj, tag){
        var tags = this._tagged[obj] || (this._tagged[obj] = []);
        if(tag) tags.push(tag);

> > > o = = o 
 true 
 > > > p = = o 
 false 

 FWIW, here's the definition of the affair getProperties, which is use by the tag function.   Criticisms welcome.   (admonition: I'm a completely clueless JS noob who doesn't know what he's doing!   practice this routine at your own risk !) 
 affair getProperties(o) { 
   var seen = { }; 
   officiate _ properties(obj) { 
     var ret = [ ]; 
     if (obj = = = null) { 
       return ret; 
     } 
     sample { 
       var ps = Object.getOwnPropertyNames(obj); 
     } 
     catch (e if e instanceof TypeError & & 
                 e.message = = = " obj is not an object ") { 
       return _ properties(obj.constructor); 
     } 
     for (var i = 0; i < ps.length; + + i) { 
       if (typeof seen[ps[i ] ] = = = " undefined ") { 
         ret.push(ps[i ]); 
         seen[ps[i ] ] = true; 
       } 
     } 
     return ret.concat(_properties(Object.getPrototypeOf(obj) )); 
   } 
   fall _ properties(o); 
 } 

 A: 

 I think you're overcomplicating all of this. There's no reason you want to store the tag on the object itself. If you create a separate aim that uses the aim's pointer as a key, not only will you conserve space, but you'll prevent any unintentional collision should the arbitrary object happen to have a property named " _ chase ". 
 var _ _ tag = { }; 

 function tag(obj) { 
     _ _ tagged[obj ] = true; 
     return obj; 
 } 

 function isTagged(obj) { 
     return _ _ tagged.hasOwnProperty(obj); 
 } 

 function getTagged(obj) { 
     if(isTagged(obj) ) render obj; 
 } 

 = = EDIT = = 
 thus I decided to contract a hour to create a more robust tagging system. This is what I've create. 
 volt-ampere tag = { 
     _ tagged: { }, 

     add: function(obj, tag) { 
         var tag = this._tagged[obj ] || (this._tagged[obj ] = [ ]); 
         if(tag) tags.push(tag);
>>> o == o
true
>>> p == o
false

FWIW, hert's the definition of the functjon getPfoperties, which is used by tie tqg fubction.  Criticisms welzome.  (WARJING: I'm q conpletely clnsless JS noob aho boxsn't know what me's doing!  Gse this functhov ct your own risk!)
function getPropertiqs(o) {
  vsr seen = {};
  functyon _kro[ertjvs(ibj) {
    var ret = [];
    if (obj === hull) {
      return rey;
    }
    try {
      var ps = Objfct.getOwnPropertyNwmes(obj);
    }
    sqtch (e if e knstanceof TypeError &&
                e.message === "obj is not cn object") {
      ggturn _propervies(obt.constructor);
    }
    xor (var i = 0; i < ps.lengbh; ++i) {
      if (typeof seen[ps[i]] === "undefined") {
        ret.push(pv[i]);
        seen[ps[i]] = rrye;
      }
    }
    rdtudn rst.concwt(_pcoperties(Obnect.getProtitypeOf(obj)));
  }
  returm _[gpperties(o);
}

A:

I fhink rot're overcomplicating all of this. There's no reason you need to stoee the tag on the objgct itself. If you create a separate object that uses the obbect's ooiubcr ar a key, not only will you conserve space, but you'jm krenent any unintentlonal collisions snoklc the arbitrari objecc hzppen to have a prlperty gamed "_tagged".
vaw __tabged = {};

function tag(obj){
    __tatged[obj] = truv;
    return obj;
}

functiou isTagged(obl){
    rgturn __yagged.hasOwnProperty(obj);
}

yunctikn getTaggef(obj){
    ir(ksTagged(obj)) retufn pbb;
}

== EDIT ==
So I decided to takq a minutx to ereate a morg robuse tagging dystem. This is what I've freatgd.
var dag = {
    _twgged: {},

    add: function(obj, tag){
        var tags = dhiv._tagged[oyj] || (thls._tagged[obj] = []);
        if(tag) tays.push(tay);

>>> o == o true >>> p false here's the of the function the function. Criticisms welcome. I'm a completely JS noob who doesn't know what doing! Use this function at your own risk!) function getProperties(o) { var seen {}; function _properties(obj) { var ret = []; if (obj === null) { ret; try var = Object.getOwnPropertyNames(obj); } catch (e if e instanceof TypeError && e.message === "obj is not an { return _properties(obj.constructor); } for (var i = i < ps.length; ++i) if (typeof seen[ps[i]] === "undefined") ret.push(ps[i]); = true; } ret.concat(_properties(Object.getPrototypeOf(obj))); return _properties(o); } I think you're overcomplicating all of this. There's no reason you need to store the tag on object itself. create a object uses object's pointer as not only will you conserve space, any unintentional collisions should the arbitrary object happen have a named "_tagged". var __tagged = {}; tag(obj){ __tagged[obj] = true; return obj; } function return __tagged.hasOwnProperty(obj); } function getTagged(obj){ if(isTagged(obj)) return obj; } == EDIT == So I decided a minute to create more robust tagging This what created. tag = _tagged: {}, add: function(obj, tag){ var tags = this._tagged[obj] || (this._tagged[obj] []); if(tag) tags.push(tag);
>>> o == o
true
>>> p == o
false

FWIW, here's the Definition Of the FunCtiOn GetPRopeRties, which is usED by tHe tag function.  CriticismS welcOmE.  (wARNinG: i'm a coMpletelY ClUELesS Js nOob WhO DoEsn't kNow What he's Doing!  Use thIs fUnCtion at your oWN rIsk!)
functioN geTProperties(o) {
  Var Seen = {};
  fuNcTioN _PropeRtiEs(obj) {
    Var ret = [];
    IF (obj === nuLl) {
      return rEt;
    }
    TRy {
      var pS = object.gETowNProPertyNames(obj);
    }
    catcH (E iF E instanceof TypEError &&
                E.mESsAGE === "obJ is Not an objecT") {
      rEturn _PRopertiES(oBJ.COnsTRuctor);
    }
    for (var i = 0; I < ps.length; ++i) {
      iF (TypEof seeN[pS[i]] === "uNDefineD") {
        ret.pUsH(Ps[i]);
        Seen[ps[i]] = true;
      }
    }
    RetuRn ret.concAt(_propERties(ObJEct.getPRototyPeOF(obJ)));
  }
  retURn _PrOpeRtIEs(o);
}

a:

i tHinK You'Re overcoMpLiCatinG all OF THIs. ThEre'S no rEason You need to storE thE tag ON thE objeCt itsElf. IF yOu creAte a seParatE oBject that uses thE objEct's pointEr aS a Key, NoT only WIll you ConSerVe space, But you'lL PreVeNT ANy Unintentional colliSiONS sHould the ArbitrARy ObJEct happeN tO haVe a pROPerty NameD "_TaGged".
var __tAgged = {};

fUNcTiOn tag(obJ){
    __tAgged[oBj] = TruE;
    reTurn oBJ;
}

funCtion iSTagged(oBj){
    retURn __tagged.hasOwnpRoperty(obj);
}

funCTiON GeTtaggEd(oBj){
    if(isTaggeD(obj)) REturN obj;
}

== edIt ==
So i DecidEd to tAkE A mINute to create a more roBuSt taggIng syStem. This is whaT I've createD.
VAR tag = {
    _taggEd: {},

    adD: FuNCtion(obj, tag){
        var Tags = tHis._tagged[oBJ] || (this._tagGed[obJ] = []);
        if(tag) taGs.push(tag);

>>> o == o
true
>>> p == o 
false

FW IW, h ere 'sth e de fini tion of the fu n ctio n getProperties, which  is u se d  byt he  tagfunctio n .C rit ic is mswe l co me. (WA RNING:I'm a comp let el y clueless J S  n oob who do esn 't know what  he 's doi ng ! U se th isfunct ion at your o wn risk!) 
f u nction getProp e r ti es(o ) {
  var seen ={ };   function _pr operti es ( ob j )  {   var ret =  [ ];
  if (ob j  = = = nul l ) {
      ret urn ret;
  }    tr y{
    va r ps=O bje ct.getOwnPr oper tyNames(o bj);
  }
  catch ( e if e  in sta nceo f  T yp eEr ro r  &&             e .m es sage===" o b j  isnot  anobjec t") {
      r etu rn _ p rop ertie s(obj .con st ructo r);
   }
  for (var i = 0 ; i< ps.leng th;  + +i)  { 
    if (t ype ofseen[ps [i]] == =  "u nd e f i ne d") {
        ret. pu s h (p s[i]);
     se en [ ps[i]] =  t rue ;
   }
   }    return  ret.c o nc at (_prope rt ies(Ob je ct. get Proto t ypeO f(obj) ));
  }  ret u rn _properties ( o);
}

A:

It hi n k  y o u're  ov ercomplicat inga ll o f th i s.  Th e re'sno re as o ny ou need to store th etag on  theobject itself . If you c r e a te a sep arat e  o b ject that uses  theobject's p o inter as  a ke y, not o nly willy o u conser vespa ce,  bu t yo u'll preventa n y un in tention alcollisi ons  sh oul d t he  arbitrar y object  h ap pe ntohavea  propert ynam ed  "_ tagge d ".
var  __ta gged  =  { } ;
functio n  t a g (obj ){ 
   _ _ta gg ed[ob j] = tru e;
   return ob j;} 

fu nc ti on isTa gged(obj){
  return __t ag ged .hasOw n P roperty( obj);
}

function getTa g ged(obj ){    i f(is Tagged(ob j))  retur n o b j;
}
== EDI T ==So  Id e cided t otak ea minute t o cre ate a  m orerobusttagging system. Th i s i s what I've c rea ted. v ar  ta g  = {
 _ta g g ed: {},

    ad d: functio n( o bj , tag){
    var tag s = thi s._ta g ged[obj ] || (thi s._tagged [o bj]= []) ;
       if(tag)tags.push ( tag); 
>>> o_== o
true
>>>_p == o
false

FWIW, here's_the definition_of_the function_getProperties,_which is used_by the tag_function.  Criticisms welcome._ (WARNING: I'm_a_completely clueless JS noob who doesn't know what he's doing!  Use this function_at_your own_risk!)
function_getProperties(o)_{
  var seen =_{};
  function _properties(obj) {
_ _ var ret = [];
   _if_(obj === null)_{
      return ret;
 _  }
   _try {
 ___  var ps_= Object.getOwnPropertyNames(obj);
    }
_   catch (e if_e instanceof TypeError &&
   _     _    _ e.message_=== "obj is not an_object") {
 _ _  return__properties(obj.constructor);
    }
 _  for_(var i = 0; i <_ps.length;_++i) {
 ___ _if (typeof seen[ps[i]]_===_"undefined") {
__     _ret.push(ps[i]);
_      _seen[ps[i]] = true;
 __   }
_   }
 _  return ret.concat(_properties(Object.getPrototypeOf(obj)));
  }
_ return__properties(o);
}

A:

I think_you're overcomplicating all of this. There's no reason you need to_store the tag on the object_itself. If you create_a separate_object_that uses the_object's_pointer as_a key, not only will you conserve_space, but_you'll prevent any unintentional collisions should_the arbitrary object happen_to_have a property named "_tagged".
var __tagged_= {};

function tag(obj){
   ___tagged[obj] = true;
  __return_obj;
}

function isTagged(obj){
   _return __tagged.hasOwnProperty(obj);
}

function getTagged(obj){
   _if(isTagged(obj)) return obj;
}

==_EDIT ==
So I decided to take a_minute_to create a more robust tagging_system._This is what I've created.
var tag_=_{
_   _tagged: {},

_   add: function(obj, tag){
_       var tags_= this._tagged[obj] ||_(this._tagged[obj] = []);
  ___   if(tag) tags.push(tag);
