2 ms·
To be honest it makes sense for it. It means if something (a library, browser API etc.) has no type, you can write an interface for it and hint for it, without
by slver 6y ago
To be honest it makes sense for it. It means if something (a library, browser API etc.) has no type, you can write an interface for it and hint for it, without depending on anything else.
You can think about the structural type as a hash check on a type. If the hash matches, chances are it's the type you want. Collisions are possible, but highly unlikely, hence why in practice it works great (and we still have instanceof and tagged types).