Concepts
Origin tuple comparison
For ordinary HTTP(S) URLs, equality compares normalized scheme, host and port. This does not generalize to opaque origins.
Formal Syntax & Structure
javascript syntaxjavascript
new URL(a).origin === new URL(b).originWorking Example
Example Snippetjavascript
(async () => {const a=new URL("https://app.example/list"),b=new URL("https://app.example:443/detail"),c=new URL("https://app.example:8443/list");console.log(a.origin===b.origin,a.origin===c.origin);})()