If you replace the ternary with an if then it's easy to understand for anyone who knows what ... means (which imo every JS developer should know)
const count = (amount: number) => {
if (amount > 0) {
return [...count(amount - 1), amount]
} else {
return []
};
}