You are viewing a single thread.
View all comments
2 points

I presume the details of this post got lost somewhere?

let x = () => ({ name: "Alice" }); let y = () => ({ name: "Alice", location: "Seattle" }); x = y; // OK y = x; // Error, because x() lacks a location property

https://www.typescriptlang.org/docs/handbook/type-compatibility.html

There doesn’t seem to be an article directly on subtypes

permalink
report
reply

Community stats

  • 1

    Monthly active users

  • 28

    Posts

  • 6

    Comments