In javascript to check if a variable was never created, we just do
if (typeof MyVariable !== "undefined"){ ... }
I was wonder how I do that in coffeescript?… I try something like
if (MyVariable?false){ ... }
but this check if MyVariable is a function if so that will call MyVariable(false) if not that will call void(0) or something like that.
Finally I found this easy way to do it:
that will generate:
UPDATE 04/07/2014
Demo Link