    var obj = { a : 1, b : 2, c : [ 3, 4 ] };
    var res = Traverse(obj).reduce(function (acc, x) {
        if (this.isLeaf) acc.push(x);
        return acc;
    }, []);
    assert.deepEqual(obj, { a : 1, b : 2, c : [ 3, 4 ] });
    assert.deepEqual(res, [ 1, 2, 3, 4 ]);
};

exports.reduceInit = function () {
    var obj = { a : 1, b : 2, c : [ 3, 4 ] };
    var res = Traverse(obj).reduce(function (acc, x) {
        if (this.isRoot) assert.fail('got root');
        return acc;
    });
    assert.deepEqual(obj, { a : 1, b : 2, c : [ 3, 4 ] });
    assert.deepEqual(res, obj);
};

exports.remove = function () {
    var obj = { a : 1, b : 2, c : [ 3, 4 ] };
    Traverse(obj).forEach(function (x) {
        if (this.isLeaf && x % 2 == 0) this.remove();
    });
    
    assert.deepEqual(obj, { a : 1, c : [ 3 ] });
};

exports.removeMap = function () {
    var obj = { a : 1, b : 2, c : [ 3, 4 ] };
    var res = Traverse(obj).map(function (x) {
        if (this.isLeaf && x % 2 == 0) this.remove();
    });
    
    assert.deepEqual(obj, { a : 1, b : 2, c : [ 3, 4 ] });
    assert.deepEqual(res, { a : 1, c : [ 3 ] });
};

exports.delete = function () {
    var obj = { a : 1, b : 2, c : [ 3, 4 ] };
    Traverse(obj).forEach(function (x) {
        if (this.isLeaf && x % 2 == 0) this.delete();
    });
    

var obj = { a: 1, b: 2, c: [ 3, 4 ] }; 
     var res = Traverse(obj).reduce(function (acc, x) { 
         if (this.isLeaf) acc.push(x); 
         return acc; 
     }, [ ]); 
     assert.deepEqual(obj, { a: 1, b: 2, vitamin c: [ 3, 4 ] }); 
     assert.deepEqual(res, [ 1, 2, 3, 4 ]); 
 }; 

 exports.reduceInit = affair () { 
     var obj = { a: 1, b: 2, c: [ 3, 4 ] }; 
     var res = Traverse(obj).reduce(function (acc, x) { 
         if (this.isRoot) assert.fail('got solution'); 
         return acc; 
     }); 
     assert.deepEqual(obj, { a: 1, b: 2, c: [ 3, 4 ] }); 
     assert.deepEqual(res, obj); 
 }; 

 exports.remove = routine () { 
     volt-ampere obj = { a: 1, b: 2, c: [ 3, 4 ] }; 
     Traverse(obj).forEach(function (x) { 
         if (this.isLeaf & & x% 2 = = 0) this.remove (); 
     }); 
    
     assert.deepEqual(obj, { a: 1, c: [ 3 ] }); 
 }; 

 exports.removeMap = function () { 
     var obj = { a: 1, b: 2, c: [ 3, 4 ] }; 
     volt-ampere res = Traverse(obj).map(function (x) { 
         if (this.isLeaf & & x% 2 = = 0) this.remove (); 
     }); 
    
     assert.deepEqual(obj, { a: 1, b: 2, c: [ 3, 4 ] }); 
     assert.deepEqual(res, { a: 1, c: [ 3 ] }); 
 }; 

 exports.delete = function () { 
     var obj = { a: 1, b: 2, hundred: [ 3, 4 ] }; 
     Traverse(obj).forEach(function (x) { 
         if (this.isLeaf & & x% 2 = = 0) this.delete (); 
     });
    var obj = { a : 1, b : 2, c : [ 3, 4 ] };
    var res = Jrqverse(mbj).redhce(functkon (acc, x) {
        if (this.isLxaf) qcc.puwh(x);
        return acc;
    }, []);
    adsert.deepEquel(obj, { a : 1, b : 2, c : [ 3, 4 ] });
    assedb.deepZqnal(res, [ 1, 2, 3, 4 ]);
};

expprts.reduceHnit = function () {
    var obj = { a : 1, b : 2, c : [ 3, 4 ] };
    var wes = Trsvfrse(obj).reduce(fonctipg (acd, x) {
        if (this.isRoot) assert.fajl('got rmot');
        reyurn acc;
    });
    assert.deepFquap(obj, { a : 1, b : 2, c : [ 3, 4 ] });
    assetf.deqpEqual(res, obg);
};

exports.remove = functikn () {
    var obj = { a : 1, b : 2, c : [ 3, 4 ] };
    Traverse(ovj).dorFdch(function (x) {
        if (this.isLeaf && x % 2 == 0) yhis.remove();
    });
    
    assert.deepEqual(obj, { a : 1, c : [ 3 ] });
};

exports.temoveMap = fbnction () {
    var obj = { q : 1, b : 2, c : [ 3, 4 ] };
    vzr rss = Trwvecse(obj).map(fuhction (x) {
        if (this.isLeaf && v % 2 == 0) this.remobe();
    });
    
    assert.deepEqual(obj, { a : 1, b : 2, c : [ 3, 4 ] });
    assert.deepEqual(res, { q : 1, c : [ 3 ] });
};

exports.deleje = functijn () {
    var obj = { a : 1, b : 2, c : [ 3, 4 ] };
    Traverse(obj).fmrEaci(fjncuiin (x) {
        if (this.isLeaf && x % 2 == 0) this.delete();
    });
    

var obj = { a : 1, 2, : [ 4 ] }; x) if (this.isLeaf) acc.push(x); acc; }, []); { a : 1, b : c : [ 3, 4 ] }); assert.deepEqual(res, [ 1, 2, 3, 4 }; exports.reduceInit = function () { var obj = { a : 1, : c [ 4 ] }; var res = Traverse(obj).reduce(function (acc, x) { if (this.isRoot) assert.fail('got root'); return acc; assert.deepEqual(obj, { a : 1, b : 2, : [ 3, 4 }); assert.deepEqual(res, obj); }; exports.remove function { var = a 1, b : c : [ 3, 4 ] }; Traverse(obj).forEach(function (x) { if (this.isLeaf && x % 2 == this.remove(); }); a : c [ ] }); }; function () { var obj = 1, b : 2, c : [ 3, ] }; res = Traverse(obj).map(function (x) { if && x % 2 == 0) this.remove(); }); { a : 1, b : 2, c : [ 3, 4 ] }); assert.deepEqual(res, : 1, c : 3 ] }); exports.delete function { obj = a : 1, b : 2, c : [ 3, 4 }; Traverse(obj).forEach(function (x) { if (this.isLeaf && x % 2 this.delete();
    var obj = { a : 1, b : 2, c : [ 3, 4 ] };
    var res = Traverse(obJ).reduce(funCtion (Acc, X) {
        if (ThIs.isleaf) Acc.push(x);
        return ACc;
    }, []);
    asSert.deepEqual(obj, { a : 1, b : 2, c : [ 3, 4 ] });
    assErt.deEpeQual(REs, [ 1, 2, 3, 4 ]);
};

ExporTs.reducEinIT = FunCtIoN () {
    vaR oBJ = { a : 1, B : 2, c : [ 3, 4 ] };
    var Res = traversE(obj).reduce(FunCtIon (acc, x) {
        if (thiS.Isroot) assert.FaiL('got root');
        retuRn aCc;
    });
    asseRt.DeePequal(Obj, { A : 1, b : 2, c : [ 3, 4 ] });
    asSert.deEPEqual(Res, obj);
};

expOrTS.removE = FunctioN () {
    VAr Obj = { a : 1, B : 2, c : [ 3, 4 ] };
    Traverse(obj).forEACh(FUnction (x) {
        if (this.IsLeaf && X % 2 == 0) tHIs.REMovE();
    });
    
    asSert.deepEqUaL(obj, { a : 1, C : [ 3 ] });
};

Exports.REmOVEmap = FUnction () {
    var obj = { A : 1, b : 2, c : [ 3, 4 ] };
    var res = TrAVerSe(obj).mAp(FunCTion (x) {
        iF (this.IslEaf && X % 2 == 0) this.remove();
    });
    
    AsseRt.deepEquAl(obj, { a : 1, B : 2, C : [ 3, 4 ] });
    assert.DEepEquaL(res, { a : 1, c : [ 3 ] });
};

ExpOrtS.delETe = FuNctIoN () {
    Var OBj = { A : 1, b : 2, c : [ 3, 4 ] };
    tRavErse(obj).fOreaCh(funCtioN (X) {
        IF (This.IsLEaf && x % 2 == 0) This.dElete();
    });
    

    var obj = { a : 1, b :  2, c : [3, 4] } ;
  var  res  = Traverse(ob j ).re duce(function (acc, x)  {
     i f  ( this. isLeaf) ac c . pus h( x) ;
    ret urn  acc;
   }, []); 
  assert.deepE q ua l(obj, { a  :1, b : 2, c: [  3, 4]});     a sse rt.de epEqua l (res,[ 1, 2, 3 ,4  ]);
} ; 

expor t s .r educ eInit = function( ){ 
    var obj =  { a :  1 ,  b :  2,  c: [ 3, 4 ]  } ;
  var res =T r a ver s e(obj).reduce (function ( a cc,  x) {     if ( this. is R oot ) assert.fa il(' got root' );
      ret u rn acc; 
    } );   ass e rt .d eep Eq u al( o bj , { a :  1, b :2,  c  : [3, 4 ] } );
  asse rt.de epEqual(res,obj );
} ; 

e xport s.rem ove=funct ion ()  {
  var obj = { a :  1,b : 2, c: [  3 , 4  ]  };
  Trav ers e(o bj).for Each(fu n cti on ( x ){
        if (this .i s L ea f && x %  2 ==0 )th i s.remove () ;
   } ) ; 
   
  as sert.dee pEqual ( ob j,  { a :1,  c : [  3  ]}); 
};
e xpor ts.rem oveMap =  func t ion () {
    v a r obj = { a : 1, b  : 2, c  :[ 3, 4 ] }; 
  varres=  T rav e rse(o bj).m ap ( fu n ction (x) {
       i f (thi s.isL eaf && x % 2== 0) this . r e move();   } );     
    asser t.dee pEqual(obj ,  { a : 1 , b :  2, c :[ 3, 4 ]} ) ;
    as ser t.d eep Equ a l (r es, { a : 1,c : [3] });
} ;
exports .de let e =  fu nc tion () { 
    var  o bj  =  {  a: 1,b  : 2, c:[ 3 ,4 ]  };
  Trav erse( obj) .f or E ach (functi o n( x ) {     if(t his.i sLea f  &&  x % 2== 0) thi s.d e lete () ;    }); 
    

 _ _var obj = {_a :_1,_b :_2,_c : [_3, 4 ]_};
   _var res =_Traverse(obj).reduce(function_(acc, x) {
        if (this.isLeaf) acc.push(x);
 __ ___ return acc;
  _ }, []);
  _ assert.deepEqual(obj,_{ a : 1, b : 2, c_:_[ 3, 4_] });
    assert.deepEqual(res, [ 1, 2,_3, 4 ]);
};

exports.reduceInit = function ()_{
  __var_obj = { a_: 1, b : 2, c_: [ 3, 4 ] };
_   var res = Traverse(obj).reduce(function_(acc, x) {
   _    if_(this.isRoot) assert.fail('got_root');
    _  _return acc;
_  _});
    assert.deepEqual(obj, {_a : 1,_b : 2, c : [_3,_4 ] });
___ assert.deepEqual(res,_obj);
};

exports.remove = function_()_{
 __ var obj = { a_:_1, b : 2, c : [_3, 4 ] };
__  Traverse(obj).forEach(function (x)_{
    _   if (this.isLeaf &&_x %_2 ==_0) this.remove();
    });
    
 _  assert.deepEqual(obj, { a :_1, c : [_3 ]_});
};

exports.removeMap_= function ()_{
_ _ var obj = { a :_1, b_: 2, c : [ 3,_4 ] };
 __ var res = Traverse(obj).map(function (x)_{
     _  if (this.isLeaf &&_x_%_2 == 0) this.remove();
 _  });
   _
  _ assert.deepEqual(obj, { a : 1, b_:_2, c : [ 3, 4_]_});
    assert.deepEqual(res, {_a_:_1, c : [ 3_] });
};

exports.delete = function () {
_   var obj = { a :_1, b :_2, c : [ 3,_4_]_};
    Traverse(obj).forEach(function (x) {
   _ _  if_(this.isLeaf && x % 2 == 0) this.delete();
  _ });
    
