Skip to content

Instantly share code, notes, and snippets.

@spion
Created October 3, 2012 15:39
Show Gist options
  • Save spion/3827639 to your computer and use it in GitHub Desktop.
Save spion/3827639 to your computer and use it in GitHub Desktop.
typescript recursive interface test
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