這工作,但確實有任何建議爲寫這更簡單的/優雅的方式?:有沒有更優雅的方式來編寫這個CoffeeScript?
if @mediaAddQueue[''+mid]['mediaType'] is 'photo' and
@mediaAddQueue[''+mid]['econ_status'] is 'loaded' and
@mediaAddQueue[''+mid]['medium_status'] is 'loaded' and
@mediaAddQueue[''+mid]['thumb_status'] is 'loaded' and
not @mediaAddQueue[''+mid]['targetEventRecord']?
@addMedia @mediaAddQueue[''+mid]['targetEventRecord'], mid, @mediaAddQueue[''+mid]['mediaType']
else if @mediaAddQueue[''+mid]['mediaType'] is 'video' and
@mediaAddQueue[''+mid]['video_status'] is 'loaded' and
not @mediaAddQueue[''+mid]['targetEventRecord']?
@addMedia @mediaAddQueue[''+mid]['targetEventRecord'], mid, @mediaAddQueue[''+mid]['mediaType']
「是否有更優雅的方式來編寫此CoffeeScript?」 - 當然,用C重寫:P – 2013-02-07 22:43:57