Which fix removes the bug?
const emails = rows.map((r) => r.email.toLowerCase());
- Guard it:
r.email?.toLowerCase() ?? '' - Guard it:
r.email!.toLowerCase() ?? '' - Filter the rows after the map call
- Change
mapinto aforEachloop
One row without an email throws and kills the whole map; guard the access.
Play Problem Solving ▸