Should I use typeof in TypeScript?

typeof is used when you need to distinguish between types number , string , boolean , and symbol . Other string constants will not error, but won’t be used to narrow types either. Unlike instanceof , typeof will work with a variable of any type. In the example below, foo could be typed as number | string without issue.

Sizin İçin Seçtik  1 gün adli para cezası ne kadar?

Leave a Reply

Your email address will not be published. Required fields are marked *