Ask coding questions

← Back to all posts
Bug Report - Plus Sign Casting in TypeScript Not Working
JimLynch (4)

Hi, i would like to report a bug for the TypeScript Repls.

the plus sign (+) can be used immediately before parens to caste the expression to a number.


const thing = +("4" + "2")

^ thing should be the number 42, but on this does not even compile...

SixBeeps (5036)

Repl doesn't use it's own runtime for languages, it uses pre-existing compilers/interpreters.
I think your issue is that you never called your function. I tried the syntax in the console and it worked fine.

Bookie0 (5937)

Use this for the bugs:

Hope this helps! : )