All language subtitles for 009 Arrow Functions_en

af Afrikaans
ak Akan
sq Albanian
am Amharic
ar Arabic Download
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
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 what you see here is one way

of defining a function

but I'm going to comment out this approach here

for the moment because there also is an alternative.

In JavaScript,

you can also create so-called arrow functions,

a syntax that's especially popular

if you're dealing with anonymous functions,

a function that don't need a name.

For example, here in this React app I showed you

in the first course section, you might remember

that on the buttons we had this on click attribute

and we used some React syntax to point at a function

that should be executed when the button is clicked.

And for that here I used this arrow function syntax

to define a function in the place where it's needed

as a value for this click listener.

And this is a so-called anonymous function

because it doesn't carry any name.

It's just the function code.

Now, anonymous functions can also be defined

with the function keyword.

You can define functions like this

and for example, console log Hello.

And we could then, for example, export this as a default

if we wanted to, and we would now be exporting

a so-called anonymous function which doesn't carry any name.

But if you are dealing with such anonymous functions

you can use the arrow function syntax as well

since this is a bit shorter.

When using arrow functions,

you omit the function keyword, you must not use it

and you instead just have your parameter list here

like for example, username and message.

This doesn't change.

Then you have this arrow

and then you have the curly braces

which contain the function body.

You can also still use the return keyword here

if you want to, and that's how you would define a function

using this arrow function syntax.

In this course, you'll see both kinds of functions

using the function keyword

and using this arrow function notation.

Ultimately, it is up to you which approach you prefer

but you should know about both.

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