- [Instructor] Let's go through the solution
of the challenge.
Keep in mind that the array you've built could have been
anything you wanted.
It could have single strings, numbers, objects.
As long as they are globally available
and we console.log this variable from a function,
it all works.
So let's take a look at mine.
So what I've done here is declare and define an array here.
So the array of warriors
with properties named type, weapon, agility.
And I had three of 'em.
And then as you see in the notes,
this is globally available.
So I could use this array anywhere in this file
or if I've exported this function
and then imported it into another file,
I could use it as well.
Now this function is also global
because it's at the top of my file.
There's no function on top of it
so it's not scoped inside of another function.
It's available and also it returns
into the console the list of warriors here.
So if we run that function, there's no issues.
So let's go into the browser.
And as expected, you see, basically, three objects here.
So on the array of objects
and you can see all of the items
from that object, as expected.
So hopefully you had as much fun as I did on this one.
As long as you coded an array of warriors
or anything that you wanted in here,
as long as these objects,
or even it could have been simple strings,
simple numbers, it didn't matter,
as long as you add that
and it was globally available,
as long as you had a function
that was globally available as well,
then you did good on this challenge.
All right, so let's move on.