Understanding Type 'string | undefined' Is Not Assignable to Type 'string' in TypeScript | CodeTrail