1
00:00:02,350 --> 00:00:06,820
Now at this point of time, I want to talk about arrow functions real quick because here we can really

2
00:00:06,820 --> 00:00:10,210
see why they shine. With arrow functions,

3
00:00:10,210 --> 00:00:12,160
you can shorten this code a lot.

4
00:00:12,160 --> 00:00:17,630
It's already quite short and it would definitely be longer if you had the function keyword here but

5
00:00:17,630 --> 00:00:23,840
with arrow functions, the examples like this one where I really only use the price, we can drop the

6
00:00:23,840 --> 00:00:29,480
other two arguments, therefore we can drop the parentheses as you learned and since we only have one

7
00:00:29,480 --> 00:00:33,960
expression in there, we can even drop the curly braces like this,

8
00:00:34,040 --> 00:00:40,790
then we also have to remove the return statement and also the semicolon and instead write this code.

9
00:00:40,790 --> 00:00:45,620
This expressions result will then be returned by the function automatically

10
00:00:45,620 --> 00:00:49,240
and if this isn't short, well then I don't know what's short.

11
00:00:49,280 --> 00:00:54,170
This is super short and concise and of course you could even make it shorter by shortening this argument

12
00:00:54,170 --> 00:00:54,870
thing,

13
00:00:54,950 --> 00:01:00,680
of course you should try to still make sure it's readable and understandable but this should be understandable.

14
00:01:00,710 --> 00:01:03,100
So this is how short this can be

15
00:01:03,170 --> 00:01:08,030
and of course there are other places in the code we wrote thus far where you can also shorten your

16
00:01:08,030 --> 00:01:09,110
functions.

17
00:01:09,110 --> 00:01:14,900
So that's why arrow functions really are a great addition to Javascript in general and why they really

18
00:01:14,900 --> 00:01:17,780
shine when we talk about these array methods.

19
00:01:17,780 --> 00:01:22,760
It's just something I wanted to highlight here because I often write a bit more verbose code to be

20
00:01:22,760 --> 00:01:26,680
as understandable as possible but this is also what you can do

21
00:01:26,720 --> 00:01:29,150
and this is super short and concise as you can tell.
