20 Mart 2022 Pazar

TypeScript Temel Tipler

Giriş
Açıklaması şöyle
... below is a list the most fundamental TypeScript types you will see the most:

undefined - when something is not defined in the code, or does not exist.
any - refers to any type - essentially not enforcing a type at all.
enum - an enum - see here for more on enums.
number - a number between -2^53 - 1 and 2^53 - 1, i.e. 1.
string - a combination of characters i.e. test.
boolean - true or false.
bigint - a number bigger than 253 - 1.
symbol - a completely unique identifier.
function - self-explanatory - a function.
object - an object or array
never - used in functions - for when a function never returns a value, and only throws an error.
void - used in functions - for when a function never returns a value.
Örnek
Şöyle yaparız
subject: string = "abc";