Created
September 4, 2016 11:37
-
-
Save buntine/abb5f890156230f66a02cb00c18107d2 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
interface Lengthwise { | |
length: number; | |
} | |
function logger<T extends Lengthwise>(arg: T): void { | |
console.log(arg.length); | |
} | |
logger([1,2,3]); | |
logger({length: 20}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment