@jiggliemon, this will always return true on any object you pass. -- Fábio Miranda Costa Solucione Sistemas Engenheiro de interfaces Twitter: fabiomiranda http://solucione.info
On Sun, Jun 6, 2010 at 7:57 PM, jiggliemon <[email protected]> wrote: > It wasn't clear to me if needed to compare each individual value in > the obj's. > But this will compare them as a whole and let you know if you even > need to bother iterating. > > console.log(obj1.toString==obj2.toString); > > > On Jun 6, 1:38 pm, אריה גלזר <[email protected]> wrote: > > OK. so i need a "as efficient as possible" solution to compare 2 objects. > A > > note is that i'm coparing objects that come from JSON, so they can only > hold > > JSONable values. > > what i'm doing right now is simply JSON.encode them and then compare the > > strings. I am assuming that for browser with native json support this > should > > be faster than iterating them both (especially true for objects, which > need > > to be checked by keys as well). > > Do you think this method is a good one? is there a better way of doing > this? > > > > -- > > Arieh Glazer > > אריה גלזר > > 052-5348-561 > > 5561 >
