Array.prototype.flatintermediateconst holey = [1, , 3, , 5]
holey.flat() // β [1, 3, 5] (holes removed)flat() removes empty slots from sparse arrays while flattening.
flat() can be combined with filter to both remove unwanted values and flatten the result.
Challenge: Implement removeHoles(arr) that filters out falsy values then calls flat().
removeHoles([1, undefined, 2, null, 3]) // β [1, 2, 3]
removeHoles([0, [1, 2], undefined]) // β [1, 2]