“意外的++”是指“ jslint中的错误 [英] The "unexpected ++" error in jslint
本文介绍了“意外的++”是指“ jslint中的错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
是 那么最佳做法是什么?
What is the best practice for that then?
Jslint解释说它增加了混乱。我真的没看到......
Jslint explains that it "adds confusion". I don't see it really...
编辑:代码,按要求:
var all,l,elements,e;
all = inElement.getElementsByTagName('*');
l = all.length;
elements = [];
for (e = 0; e < l; (e++))
{
if (findIn)
{
if (all[e].className.indexOf(className) > 0)
{
elements[elements.length] = all[e];
}
} else {
if (all[e].className === className)
{
elements[elements.length] = all[e];
}
}
}
推荐答案
如果你想遵循jslint的建议,请使用 i + = 1
。
Use i += 1
instead, if you want to follow jslint's advice.
这篇关于“意外的++”是指“ jslint中的错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文