Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save logentries-gists/b8c3d083d6229ae3cd1e to your computer and use it in GitHub Desktop.

Select an option

Save logentries-gists/b8c3d083d6229ae3cd1e to your computer and use it in GitHub Desktop.
// Declaring a simple interface that has 2 public properties x and y
interface Point {
x: Number;
y: Number;
}
function getGreaterAxisValue(point: Point) {
return (point.x > point.y) ? point.x : point.y;
}
getGreaterAxisValue({ x: 10, y: 30 }); // return 30
getGreaterAxisValue({ x: 20, y: 3 }); // return 20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment