【发布时间】:2011-10-01 08:47:34
【问题描述】:
如果我有一个复杂的 if 语句,我不想仅仅出于美观的目的而溢出,那么由于在这种情况下,coffeescript 会将返回值解释为语句的主体,那么最合理的分解方法是什么?
if (foo is bar.data.stuff and foo isnt bar.data.otherstuff) or (not foo and not bar)
awesome sauce
else lame sauce
【问题讨论】:
-
如果
not bar在第一个子句中是可能的(正如第二个子句所暗示的那样),那么引用bar.data将导致错误...
标签: coffeescript