-
• #2
Depends what you're doing, but you could just convert both objects to a String with
JSON.stringify
and compare the strings?Can you file a bug for
instanceof
? I'm kind of surprised about that - I thought those kind of issues had been ironed out a while back.I think in JS, an array is
Array
, which is also an instance ofObject
. Espruino currently has a bit of a shonky prototype chain implementation, and it's possibleinstanceof
has fallen foul of that.
I'm trying to port a deepEqual function to compare two objects and I encountered this problem. In Espruino:
in Chrome:
Is there already a deepEqual function for Espruino? I want it to compare the output of test code...