Closed
Description
⏯ Playground Link
💻 Code
const enum TestEnum {
A = 1,
B = -1
}
// "string", "string"
console.log(
typeof String(TestEnum.A),
typeof TestEnum.A.toString()
)
// "string", "number"
console.log(
typeof String(TestEnum.B),
typeof TestEnum.B.toString()
)
🙁 Actual behavior
Constant enums which use negative numbers will return type of number
when .toString()
is called.
🙂 Expected behavior
A string
type should be returned