You can convert to a number with a + before your variable.
const y = +x + 12;
Will be number addition even if x is a string.
const y = +x + 12;
Will be number addition even if x is a string.
const y = Number(x) + 12
Depending on your audience, that might be clearer in intent than `+x`.