It's an interesting way. I don't like the ternary operator thing personally, but some good ideas.
What I personally try to do, as a starting point
Both the flipping and the unwrapping of 'else' can be done by the IDE. This leaves:
const theFactorText = (number) => {
if (number % 2 === 0) {
return "Not the factor"
}
if (number % 5 === 0) {
return "That's the factor"
}
if (number < 10) {
return "Not the factor"
}
throw new Error(
"Number doesn't fall under any category. Input another"
)
}