I'm racking my brain on this, and I've read all of the previous questions that have been answered, but I feel that I'm just missing something.
JSHint gives the error:
The body of a for in should be wrapped in an if statement to filter unwanted properties from the prototype.
How would you all go about resolving this error?
function checkCollision(X, Y, arrayObjs) {
for (var obj in arrayObjs) {
var objX = (arrayObjs[obj].x / 101).toFixed(0);
var objY = (arrayObjs[obj].y / 83).toFixed(0);
//checking collision by checking character placement as well as enemies
if ((objX == (X / 101).toFixed(0)) && (objY == (Y / 83).toFixed(0))) {
//collision
return true;
}
}
return false; }