Created
May 6, 2012 05:42
-
-
Save joneath/2618020 to your computer and use it in GitHub Desktop.
CoffeeScript Typeof Ternary what?
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
# CoffeeScript version | |
params[@options.param] = if model[@options.untilAttr]?() then model[@options.untilAttr]() else model.get(@options.untilAttr) | |
# Compiled version | |
params[_this.options.param] = (typeof model[_name = _this.options.untilAttr] === "function" ? model[_name]() : void 0) ? model[_this.options.untilAttr]() : model.get(_this.options.untilAttr); | |
# Original JS version | |
params[self.options.param] = typeof(model[self.options.untilAttr]) === "function" ? model[self.options.untilAttr]() : model.get(self.options.untilAttr); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment