Skip to content

Instantly share code, notes, and snippets.

@gfodor
Created February 28, 2012 07:34
Show Gist options
  • Save gfodor/1930410 to your computer and use it in GitHub Desktop.
Save gfodor/1930410 to your computer and use it in GitHub Desktop.
-- Coffeescript
-> x ?= (-> if true then "hi")
-- Compiled (wrong?)
(function() {
(function() {
return typeof x !== "undefined" && x !== null ? x : x = (function() {
if (!true) {}
});
});
}).call(this);
-- vs, Coffeescript
-> x = (-> if true then "hi")
-- Compiled (correct)
(function() {
(function() {
var x;
return x = (function() {
if (true) return "hi";
});
});
}).call(this);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment