【发布时间】:2012-04-23 19:57:24
【问题描述】:
我有这个代码:
count = $content.find('.post').length;
for x in [1...count]
/*
prev_el_height += $("#content .post:nth-child(" + x + ")").height();
*/
prev_el_height += $content.find(".post:nth-child(" + x + ")").height();
我希望这会变成
for (x = 1; x < count; x++) { prev_el ... }
但它变成了这样:
for (x = 1; 1 <= count ? x < count : x > count; 1 <= count ? x++ : x--) {
谁能解释一下原因?
编辑:如何让我的预期语法输出?
【问题讨论】:
标签: coffeescript