Answer the question
In order to leave comments, you need to log in
How to solve no-cond-assign ESLint error?
function findPos(obj) {
let objCur = obj;
let curleft = 0;
let curtop = 0;
if (objCur.offsetParent) {
do {
curleft += objCur.offsetLeft;
curtop += objCur.offsetTop;
} while (objCur = objCur.offsetParent);
return { x: curleft, y: curtop };
}
return undefined;
}
} while (objCur = objCur.offsetParent); - Unexpected assignment within a 'do...while' statement no-cond-assign
Answer the question
In order to leave comments, you need to log in
objCur === objCur.offsetParent
Linter will not swear, but I think that this code will not work correctly
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question