Created
February 17, 2016 21:05
-
-
Save logentries-gists/b8c3d083d6229ae3cd1e to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // 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