Home > OS >  How do I call toString correctly from unknown?
How do I call toString correctly from unknown?

Time:04-10

I want to write a function that will return a string from an unknown value

Since I can't know what was originally put there, but I want to describe the type correctly, I don't use any, I use unknown.

But my question is, how to call correctly method toString from it?

I don't want typescript to complain

enter image description here

  • Related