I don’t really get the point of this. Of course the function will accept the value as a string if you specifically tell it to treat it as such (which wouldn’t even be possible without casting it to unknown
first)?
☭
I don’t really get the point of this. Of course the function will accept the value as a string if you specifically tell it to treat it as such (which wouldn’t even be possible without casting it to unknown
first)?
Yeah, I do agree that it’s a bit weird with TS. It’s fully understandable though, since it just transpiles to JS, which doesn’t have any type information during runtime. I think as far as webdev goes though, TS makes it at least somewhat bearable.
Sorry for the downvote btw - that wasn’t me!