All language subtitles for 004 Exploring the Base Types_en

af Afrikaans
ak Akan
sq Albanian
am Amharic
ar Arabic
hy Armenian
az Azerbaijani
eu Basque
be Belarusian
bem Bemba
bn Bengali
bh Bihari
bs Bosnian
br Breton
bg Bulgarian
km Cambodian
ca Catalan
ceb Cebuano
chr Cherokee
ny Chichewa
zh-CN Chinese (Simplified)
zh-TW Chinese (Traditional)
co Corsican
hr Croatian
cs Czech
da Danish
nl Dutch
eo Esperanto
et Estonian
ee Ewe
fo Faroese
tl Filipino
fi Finnish
fr French
fy Frisian
gaa Ga
gl Galician
ka Georgian
de German
gn Guarani
gu Gujarati
ht Haitian Creole
ha Hausa
haw Hawaiian
iw Hebrew
hi Hindi
hmn Hmong
hu Hungarian
is Icelandic
ig Igbo
ia Interlingua
ga Irish
it Italian
ja Japanese
jw Javanese
kn Kannada
kk Kazakh
rw Kinyarwanda
rn Kirundi
kg Kongo
ko Korean
kri Krio (Sierra Leone)
ku Kurdish
ckb Kurdish (Soranรฎ)
ky Kyrgyz
lo Laothian
la Latin
lv Latvian
ln Lingala
lt Lithuanian
loz Lozi
lg Luganda
ach Luo
lb Luxembourgish
mk Macedonian
mg Malagasy
ms Malay
ml Malayalam
mt Maltese
mi Maori
mr Marathi
mfe Mauritian Creole
mo Moldavian
mn Mongolian
my Myanmar (Burmese)
sr-ME Montenegrin
ne Nepali
pcm Nigerian Pidgin
nso Northern Sotho
no Norwegian
nn Norwegian (Nynorsk)
oc Occitan
or Oriya
om Oromo
ps Pashto
pl Polish
pt-BR Portuguese (Brazil)
pt Portuguese (Portugal)
pa Punjabi
qu Quechua
ro Romanian
rm Romansh
nyn Runyakitara
ru Russian
sm Samoan
gd Scots Gaelic
sr Serbian
sh Serbo-Croatian
st Sesotho
tn Setswana
crs Seychellois Creole
sn Shona
sd Sindhi
si Sinhalese
sk Slovak
sl Slovenian
so Somali
es Spanish
es-419 Spanish (Latin American)
su Sundanese
sw Swahili
sv Swedish
tg Tajik
ta Tamil
tt Tatar
te Telugu
th Thai
ti Tigrinya
to Tonga
lua Tshiluba
tum Tumbuka
tr Turkish
tk Turkmen
tw Twi
ug Uighur
uk Ukrainian
ur Urdu
uz Uzbek
vi Vietnamese
cy Welsh
wo Wolof
xh Xhosa
yi Yiddish
yo Yoruba
zu Zulu

Original subtitles

Now let's dig deeper into typescript.

And for this, I'll add a new basics.ts file.

In which we'll dive into some core basics you need to know

about typescript.

And for that, I wanna start with the basic types

you can work with in typescript

which you will need all the time.

And that will be our primitives, which we know

from JavaScript, numbers, strings and booleans.

And then of course, we also have more complex types

like arrays or objects, for example.

And then we're there after

we'll also talk about function types,

parameters and much more.

So that's generally what I wanna talk about here.

And let's start with the primitives here.

The primitive values we have

in JavaScript are numbers, strings, booleans

and also a null and undefined and also symbols.

But we can ignore that.

And number, string and boolean as well as null and undefined

are the important ones therefore.

Now if we have a variable, let's say, let's say the age

of a user, and we wanna make it cleater,

that India we wanna have a number.

We can make that clarification with typescript

by adding a colon after the variable name

and then simply specifying the type

of value that should be stored in this variable.

And then we can finish this variable declaration here.

If I then later assign a value, assigning a number is okay

including floats, so numbers with a decimal place

but assigning a string would give me an error.

That's what we saw before

with that function and its parameters as well.

Now, of course, we can also assign a value here right away.

We don't have to have this declaration

without a value assignment.

Both is allowed.

Now we also can of course have a username

which should be a string.

And for that, we can assign a type like this.

String is the type we wanna use here.

And one important note here,

in typescript it's number and string written like this

with lower case starting characters.

It's not number like this.

We don't get an error if we use that

but this actually points at the number object in JavaScript.

We want the number primitive type

which starts with a lowercase N, the same for string.

We want the primitive type,

which starts with a lowercase S

and then of course, here we can assign a value.

And we can also of course

store boolean values like is instructor

and add boolean as a type assignment so that their after,

I may store true or false in that variable.

And these are our core primitive value types

which we can assign, in this case to variables

before we also saw how we set types for function parameters.

And we'll see more places where we can set types

in the next minutes.

Now, as I mentioned, we also have null and undefined

as types, but we don't typically set something to be null.

If I set hobbies to null here, then this would be possible.

But then whenever I try to assign anything, I get an error

which of course is not too useful.

Instead we'll use null

and undefined in a slightly different way

which we'll learn about in a couple of minutes.

So number, strings and booleans,

are the core primitive value types we should be aware of.

Can't find what you're looking for?
Get subtitles in any language from opensubtitles.com, and translate them here.