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.

eg.

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

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

Commentshotnewtop
SixBeeps (2566)

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 (3287)

Use this for the bugs:

https://repl.it/bugs/

Hope this helps! : )