All language subtitles for 006 Classes, Properties and Methods_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
en English
eo Esperanto
et Estonian
ee Ewe
fo Faroese
tl Filipino
fi Finnish
fr French
fy Frisian
gaa Ga
gl Galician
ka Georgian
de German
el Greek
gn Guarani
gu Gujarati
ht Haitian Creole
ha Hausa
haw Hawaiian
iw Hebrew
hi Hindi
hmn Hmong
hu Hungarian
is Icelandic
ig Igbo
id Indonesian
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
fa Persian Download
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

So in the last video we learned about classes and we learned about properties and methods.

There too. Now next generation javascript also offers a different syntax of initializing properties and methods.

And actually it is this more modern syntax I'll use in this course.

So I want to show it to you here too.

You already learned that properties are like variables you attach to classes and objects, methods are

like functions attached to classes and objects and you'll learn about this syntax where we set up properties

in the constructor function.

Now there is a more modern syntax which spares us using this constructor function with next generation

javascript as we will use it in this course.

You can assign a property directly inside your class with myProperty equals value.

So you skip the constructor function call.

Behind the scenes this will still be transformed to use constructor functions.

But you'll have an easier time writing this and for methods, it's pretty similar.

This is the old way.

I showed you in the last lecture.

Now the next generation javascript way is to use the syntax from the left where you set up a property

and simply think of a method as a property which stores a function as a value and then you end up with

that.

My method equals and then an arrow function.

The great advantage of this syntax is that since you use an arrow function as a property value here you've

got no problems with the this keyword and that's the exact reason why we will use this syntax here on the

bottom right corner and the syntax on the bottom left corner throughout this course.

Let me show you the syntaxes to you.

Back to jsbin on the project we already worked on here with the human and the person class.

We can get rid of the constructor in the human class and get rid of the this keyword.

and just set gender equal to male and print.

Gender can be set equal to an arrow function where we console log.

this.gender still using the this keyword in here when we reach out to the property.

Though you may ignore that arrow for now the same for the person we no longer need the constructor

and we no longer need to call super for that reason.

Instead what we do is we call this name without this just name equal to Max and gender equal female

if you want to and printMyName equals an arrow function too, like this.

Now if you clear this and run this you will get an error because it doesn't recognize the syntax

you actually need to go to the dropdown where it says javascript and choose ES6.

Babel here.

If you do this and hit clear and run you'll see Max and female.

You'll still see the arrows on the left but you may ignore them.

This is the syntax which is next generation javascript which we will actually use in this course.

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