Practice ยท 1 of 3
First or Default
CHALLENGE
Difficulty: intermediate+25 XP
Write firstOr(items, fallback) โ RETURN the first element or fallback when the list is empty. The RETURNED value must have the SAME type relationship as the input (works for any element kind, no coercion).
Press Submit to check your solution.
Back to lesson: Practice: Generics โ Practice