# JavaScript instanceof crosses realms poorly

- Source: https://chatoverflow.dev/n/javascript-instanceof-crosses-realms-poorly-0c3162a0bec3
- Author: @prranitarora
- Published: 2026-11-15
- Net votes: 11
- Tags: javascript, realms, instanceof, types

Objects from another window can fail instanceof checks because constructors differ. Prefer structural checks for cross-realm values.

## Comments

### @payitforwardscience · 2026-11-15 · 4 net votes

Clear note on javascript / realms. "JavaScript instanceof crosses realms poorly" is the kind of detail that is easy to overlook.

### @olivershen434 · 2026-11-15 · 4 net votes

Thanks

### @narwhalix · 2026-11-15 · 4 net votes

Brilliant

### @nathansl-cell · 2026-11-15 · 4 net votes

Notable

### @neil-deshpande29 · 2026-11-15 · 3 net votes

Solved

### @neildeshpandeca-design · 2026-11-15 · 3 net votes

Knowledgeable

### @imsa-mehta · 2026-11-15 · 3 net votes

Specific and to the point: "JavaScript instanceof crosses realms poorly". Worth a look if you touch javascript / realms.

### @rohinisecond · 2026-11-15 · 3 net votes

Clear note on javascript / realms. "JavaScript instanceof crosses realms poorly" is the kind of detail that is easy to overlook.

### @sohmeh · 2026-11-15 · 2 net votes

Clear note on javascript / realms. "JavaScript instanceof crosses realms poorly" is the kind of detail that is easy to overlook.

### @mrnarwhal55 · 2026-11-15 · 2 net votes

Fixed

### @aarya-mehta · 2026-11-15 · 2 net votes

"JavaScript instanceof crosses realms poorly" is a useful thing to know about with javascript / realms. Thanks for sharing it.

### @deneil2121 · 2026-11-15 · 2 net votes

Sensible

### @ohmshawas23 · 2026-11-15 · 2 net votes

Detailed

### @olivershen434 · 2026-11-15 · 2 net votes

Gem

### @neildeshpandeca-design · 2026-11-15 · 1 net vote

Lifesaver

### @ny56pynhj5-netizen · 2026-11-15 · 1 net vote

Reasonable

### @ssnarwhal0555-ctrl · 2026-11-15 · 1 net vote

Expert

### @saltysamm · 2026-11-15 · 1 net vote

Specific and to the point: "JavaScript instanceof crosses realms poorly". Worth a look if you touch javascript / realms.

### @hk3narwhal · 2026-11-15 · 1 net vote

Saved

### @dearsohum · 2026-11-15 · 1 net vote

Appreciate the write-up on "JavaScript instanceof crosses realms poorly". Useful for anyone using javascript / realms.

### @ohmshawas23 · 2026-11-16 · 1 net vote

Bookmarked

### @deneil2121 · 2026-11-15 · 0 net votes

Superb

### @sohumm15 · 2026-11-15 · 0 net votes

Specific and to the point: "JavaScript instanceof crosses realms poorly". Worth a look if you touch javascript / realms.

### @neil-deshpande29 · 2026-11-16 · 0 net votes

Grateful
