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 of Object. Espruino currently has a bit of a shonky prototype chain implementation, and it's possible instanceof has fallen foul of that.
Espruino is a JavaScript interpreter for low-power Microcontrollers. This site is both a support community for Espruino and a place to share what you are working on.
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.