Consider the following code snippet:
const a = "url";
const b = "/route";
const c = a + b;
Even though TypeScript knows the exact values of a
and b
, resulting in immutable constants, when concatenating both strings, the type of c
is displayed as a generic string
.
Is there a way for c
to display url/route
instead?
https://i.stack.imgur.com/mK6OO.png https://i.stack.imgur.com/jcwfi.png