I'm converting some es5 into es6 and using eslint and come across the following
while(1){
// Do something
}
I'm getting a lint error
Unexpected constant condition no-constant-condition
But I'm not sure exactly what this does. It resides inside a for loop
for(i = 0; i< arr.length; i++) {
while(1) {
idx = _p.indexOf(arr[i], idx);
if (idx == -1) break;
}
}
But there was no documentation and unable to find online what exactly while(1) does and how to write an alternative to get rid of this lint error.