$('p.error:visible').eq(0)
$('p.error:visible:first')
function markDuplicates(arr) {
const map = Object.create(null);
const result = new Array(arr.length);
for(let i = 0; i < arr.length; i++) {
const key = arr[i];
switch(map[key]) {
default:
result[map[key]] = true;
map[key] = true;
case true:
result[i] = true;
break;
case undefined:
map[key] = i;
result[i] = false;
break;
}
}
return result;
}