I am testing my code on ESLint. It says:
Variable Assigned to Object Injection Sink (security/detect-object-injection).
I'm not using an outer resource to assign it to my variable, though. Is there really a problem in the var a = newArray[c];
line?
function shuffleTitleImagesArray(originArr) {
var newArray = originArr.slice(0); //copy of old array
for (var c = 0; c < newArray.length; c++) {
var b = Math.floor(Math.random() * (c + 1));
var a = newArray[c];
newArray[c] = newArray[b];
newArray[b] = a;
}
return newArray;
}