- Functions are an integral part of JavaScript.
And as you've seen, there are several different ways
of declaring a function.
In this practice assignment, I want you
to really familiarize yourself with the basics
of how to declare functions so you get used
to writing them, calling them, and making them do stuff.
Function expressions, function declarations,
and arrow functions, all have their uses,
and being comfortable with declaring all of them
and recognizing them is hugely important to your learning.
So here's what I want you to do.
Create a basic function declaration.
You'll remember, this is where we say function followed
by the name of the function.
In the body of the function declaration,
do something to an element in the DOM.
For this, you can use any
of the techniques we've covered earlier,
finding an element using QuerySelector,
adding a class, whatever you like.
Call this function declaration
so the action actually takes place
and check it in the browser.
Then next, create a basic function expression.
That's when you define a variable
and then place an anonymous function inside.
Do the same as above,
find an elements, make a change to it,
call the function, make sure it works,
and finally, create an arrow function,
make it do something and call it.
This practice assignment is all about making functions.
What the function does is less important at this point.
I want you to get familiar with getting the different types
of functions to work.