3 ms·
So I started exploring this again today, and it ends up that what you had works, but if I parens on the typeof check, it no longer works: if (typeof(x) ===
by jdmichal 10y ago
So I started exploring this again today, and it ends up that what you had works, but if I parens on the typeof check, it no longer works:
if (typeof(x) === "string")
I opened an issue: https://github.com/Microsoft/TypeScript/issues/9391 https://github.com/Microsoft/TypeScript/issues/9391
Thanks for the help!