what can I do if JSLint complains about "i" being an unused variable in such a scenario:
var items = "<option selected></option>";
$.each(data, function (i, item) {
items += "<option value='" + item.Value + "'>" + item.Text + "</option>";
});
(i, item) is the required order of parameters and I'm only using "item".
Is there any other solution than tolerating unused variables or rewriting the $.each to use the index, both solutions which I would prefer not to do?
Thanks in advance.
Update: I appreciate all the suggestions but this code is simply an example to show you what I mean and I'm interested to see a general solution, if there's any. Thanks.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…