This is how you can force TypeScript to always have at least one item in an array. Or in other words: to not allow empty arrays. You can also force it to have at least 2, 3 etc. items: This came in handy lately when I was implementing a ColorSelection component in React: Having it […]