Concept Flow - Compact for removing nil values
Start with array
Check each element
Is element nil?
Yes→Skip element
No
Keep element
Build new array without nils
Return new array
The method goes through each item in the array, skips nil values, and keeps all others to create a new array without nils.