Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
interface Point2D {
x: number;
y: number;
}
interface Point3D extends Point2D {
z: number;
}
function f(pt: Point2D) {}
let pt: Point3D = {x:1, y:2, z:3};
f(pt); // oh hey it works on 3d points too!
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.