[7, 8, , 12, , 11, 12, 13, 14, 15, 16, , , , , , , , , , , , , , ]
[7, 8, , 12, , 11, 12, 13, 14, 15, 16]
for (let i = arr.length; i--;) {
const exists = arr.hasOwnProperty(i);
if (exists || !i) {
arr.length = i + exists;
break;
}
}
for (let i = arr.length; i-- && !(i in arr); arr.pop()) ;