2012-08-16 40 views

回答

12

JSLint不喜歡增量和減量運算符。將其替換爲i += 1或將plusplus: true指令添加到文件頂部(如果您不確定如何設置JSLint指令,這裏是一個示例,它們在文件頂部的正常註釋中設置):

/*jslint plusplus: true */ 

JSLint docs

The ++ (increment) and -- (decrement) operators have been known to contribute to bad code by encouraging excessive trickiness. They are second only to faulty architecture in enabling to viruses and other security menaces.

完全荒謬的規則?你可以讓你自己的頭腦......

+1

哇,jslint ...你讓我失望 – TheZ 2012-08-16 22:25:43

+4

這是糟糕的英語.....故障架構在啓用病毒 – 2012-08-16 22:26:25

+2

是的,我同意。這是廢話。 'I ++;'自從時間開始就被使用了。 – 2012-08-16 22:27:31

-3

嘗試: 爲(VAR I = 0;我<升;我++){

如果不起作用,看看我是通過輸入我定義在控制檯中並看到響應。