I use a very handy JSLint tool to ensure that my javascript is rigorous.
I have the following code that is tagged with JSLint:
var my_obj = new Object();
var numKP = 1;
while (query.indexOf('&') > -1) {
keypairs[numKP] = query.substring(0,query.indexOf('&'));
query = query.substring((query.indexOf('&')) + 1);
numKP++;
}
keypairs[numKP] = query;
for (i in keypairs) {
my_obj[keypairs] = keypairs[i];
}
How do I fix the code above to make its JavaScript "strong" (pass JSLint authentication)?
source
share