Created
August 12, 2015 06:41
-
-
Save kdabir/49e6f7057c4f51c2ebf3 to your computer and use it in GitHub Desktop.
recursive instantiation in constructor in coffee
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
class A | |
constructor: (@a)-> | |
if @a>0 then @child = new A(@a-1) | |
console.log new A(2) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment