Description:
The formatList(arr) function will format an array of strings into a human-readable list.
Acceptance Criteria:
["apples","bananas","cherries"] → "apples, bananas, and cherries"
["apples","bananas"] → "apples and bananas"
["apple"] → "apple"
[] → "" (empty string for empty array)
The function must support proper Oxford comma handling.
Add comprehensive unit tests for arrays of different lengths (0, 1, 2, many).
Description:
The formatList(arr) function will format an array of strings into a human-readable list.
Acceptance Criteria:
The function must support proper Oxford comma handling.
Add comprehensive unit tests for arrays of different lengths (0, 1, 2, many).