dequal
dequal copied to clipboard
Fails to correctly compare objects created by constructors from another realm (like iframes)
This is definitely an edge-case, but when comparing objects like Array across iframe boundaries, instanceof will not work. See MDN's example of this: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/isArray#instanceof_vs_isArray
Thanks, TIL but that makes sense 👍
This can be fixed by avoiding instanceof or .constructor, and relying on native brand-checking mechanisms.