This double-duty functionality can prove quite useful, especially when you have things that feel like types that you want to reuse elsewhere in your code.
We can even create our own enum-like functionality:
export const Direction = {
Up: "up",
Down: "down",
Left: "left",
Right: "right",
} as const;
export type Direction = (typeof Direction)[keyof typeof Direction];We end up with a Direction type that represents "up" | "down" | "left" | "right", and a Direction constant that enumerates the values.