Bet*_*ide 18 javascript eclipse
Eclipse抱怨我的JavaScript代码:

正如我所知,代码工作正常.我有什么需要改变才能摆脱警告?
mac*_*ost 19
The semantic validator (despite it's failings, like this one) actually has a lot of uses. For instance, it can tell you when you've got a variable that's not being used anywhere (eg. because you have a typo in the variable's name).
If you don't want to see that error message, but you still want to keep semantic validation on, you can use this hack:
var textArray = 0 || [ ...
Run Code Online (Sandbox Code Playgroud)
it's a little ugly, and your non-Eclipse-using co-workers may not like it, but at least it gives you a way to ditch the warning and still have the benefits of the validator.
A similar hack (if you don't like the first one, or if you're a big Douglas Crockford fan) that will also work is:
var textArray;
textArray = [ ...
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
10776 次 |
| 最近记录: |