It's now time to practice what you learned
and for that, attached you'll find
this 'exercise.JS' file,
which is a brand new JavaScript file,
which you can add to your project folder
by dragging and dropping it in there.
And in that file, I've got some instructions for you.
As a side note, these are all JavaScript comments,
you add them by adding two forward slashes,
and anything you write thereafter
will not be interpreted as a command,
but instead as just an annotation
for you or other developers.
But now let's move on to your concrete tasks.
As you can see, I've got a couple of tasks here,
and the first task is
that you create three new variables; one variable
that stores the name of an online course of your choice
another variable that stores the price of that course,
and a third variable that actually stores
the three main goals that you might have
when taking that course.
So create these three variables
and assign any values of your choice.
Of course, think about the value types
which you plan on using.
Now, once you completed the first task, take these variables
and output alert them
as we also did it before in this section.
Now in the third task,
you will need to apply more of the things we learned.
I now want you to group these variables together,
and we did learn about a certain way of
grouping related data together.
So try grouping them together here,
give them proper names, proper labels.
And then once you did that, also still output their values.
You can still use the alert function for that,
but you will have to access your different values slightly
differently than you did it before in steps one and two.
Now in step four and task number four,
I want you to also output the second element
in your main goals, variable.
Now in task number five,
you should define your own command your own custom command,
with any name of your choice
that actually will use that main goals variable,
and access and element by its identifier.
So basically what we did in task number four,
but, unlike in task number four,
this custom command should now be a bit more flexible.
The concrete identifier, which you access should be dynamic,
there should be some way of providing a value when
that custom command is executed.
And you should then be able to
execute the same command for different identifiers.
The main goals variable also should be dynamic
inside of that command code.
This command should not just work with main goals,
but actually with any list of values.
And last but not least, this custom command should
then when you execute it, provide the accessed value,
so that in the place where you did execute
the custom command, you can use
that accessed value.
So that list element, which was retrieved by
that custom command.
Now step number six,
or task number six is to then use this custom command,
which you did define in task number five
and output alert the result four different values,
different lists, maybe,
and different identifiers of list items of your choice.
At least executed once,
but feel free to execute it more than once.
Now these are my tasks for you,
you can put your solution code or write
into this exercise JS file.
You should just make sure
that this exercise JS file is then also being used
in index HTML, (indistinct).
Maybe instead of app JS, or in addition, that's up to you.
And definitely try this exercise on your own first.
In the solution video, I will show you my solution
and I do recommend that you go
through that video also to compare your solution,
and also if you get stuck
and you're not sure how to solve something.
Because there I'll show you how I solved this
and that will then be another great exercise,
but definitely try it on your own first.