It doesn’t. It deletes the property “2”, but the index 2 remains present as a “hole” (like I mentioned before, almost a third kind of null). That removes it from iteration over the array object’s properties (i.e. your for-in loop), but doesn’t remove the index from the array or its iterable value representation:
https://www.typescriptlang.org/play/?#code/MYewdgziA2CmB0w4E...If you click run there and look at the logged output, you’ll see:
1. The length remains the same after the delete statement
2. The items after index 2 keep their index
3. The for-of loop continues to iterate over index 2 (which now produces an undefined value on read)