When I try to write multiple constructors in coffee script, i get this error: cannot define more than one constructor in a class.
How can I do this:
class Vector2
x: 0
y: 0
constructor:() ->
constructor:(@x, @y) ->
constructor:(vector) ->
x = vector.x
y = vector.y
I want to have an empty constructor and 2 other constructors. Is this possible?
simple do that in the coffeescript way: