Let's see how I'm going to solve this challenge since that create a function to reverse an array.
So my function name let me use function expression the sum around function and then let's say the reversed.
Reversed array and then equal to normal function parentheses and my care braces.
Good.
So it says that it should take in an array as an argument for parsing here.
So I need to return from this function.
What I'm getting from here as return.
Then I would take the array and then dot reverse the method on the array, array reverse.
And then I that and that is it.
I'm done.
So here, let's say by calling this function, let me comment this one out.
So let me call the function down here.
It says that when I call it, I should pass in what?
The array.
I want to reverse it.
So I can declare a variable up here or.
Okay.
It's okay.
So let's assign the results into this.
So let's say my reverse array function then remember it should pass inward.
If you pass in the array, I want to reverse.
Right.
So I can pass in in line here let's say.
And two seven.
Like that.
I clearly want to address what I see clearly as one, two, three, four, five, six.
Or we can declare everybody here, for example, cost.
Let's see, array data is equal to this.
Then I would say one, two, three, four, five, six, seven.
So this data might be from external API.
For the meantime, let's do the hard coding.
Okay.
So now the same thing as before so I can pass in my array here.
This one looks a little bit cleaner like that.
So if I console.log the response let's see.
Check the console and now let's see.
You see that I have reverse it.
You see that?
Originally we have one, two, three, four, five, six, seven.
But now I have reverse.
Seven, six, five, four, three, two, one.
That's about reverse.
The next video, let's have a look at our fourth coding challenge.