Created
October 3, 2012 15:39
-
-
Save spion/3827639 to your computer and use it in GitHub Desktop.
typescript recursive interface test
This file contains 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 LinkedListNode { | |
data:any; | |
next: LinkedListNode; | |
} | |
class MyNode { | |
data: string; | |
next: MyNode; | |
constructor(data: string, next:MyNode) { | |
this.data = data; | |
this.next = next; | |
} | |
} | |
function getnext(node: LinkedListNode) { | |
return node.next; | |
} | |
var x:MyNode = new MyNode("lol", null); | |
console.log(getnext(x)); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment