Now are be creating a random killer function that is going to help us create random functions.
Now it is no secret that colors are basically hex values, so we'll be creating a function that is going
to assign different hex values.
So let's just make a function, maybe random cut.
And this is going to be an added function.
And after we make one, let's create a let, and it's going to have color patterns, this color patterns
is going to be equal to hold up string one to starting from one two three four five six seven eight
nine.
And oh, and after this, we're going to have ABCD if.
So basically, you have all those numbers that are included in that hex values, know whatever semicolon.
And let.
Good of equal to a hashtag.
So now you might have got a pretty much idea what you going to do?
Now let's create a follow up and this follow up is going to have a let again I, which is going to be
equal to zero.
And until and unless it's less than six, we want to keep implementing it.
And what they're going to do is that will be creating color, so this color.
Should be close to collapse.
Plus.
Pattern.
And this color pattern is going to hold up a mark.
The flow.
And inside this mandatory mandate, random.
And random.
I 16.
So basically what it is going to do, it is going to assign random variables.
So ah, so we can just do the fact that it a little bit and remove those colors and put up a plus sign.
OK, so colors equals to get a bad color plus color patterns.
This color is holding up a hashtag, so we'll be having different hex values every for every iteration,
right?
So now let's return our colors.
So here is a function that is going to give different returns, different color values.
So now this function will do is that every time we call it, it is going to hit on us a different age.
We value a different hexadecimal value based on the color patterns and we are going to have different
colors.
Now, after this random color, we want to create a fetch method that is going to fetch our data from
our API, right?
So let's do it.
Let's create a functional method and call it get goods or perhaps fetch goods.
And this court is going to be another function again, and this time they'll be using Axios soap, benefit
Domino's and create a new terminal that's important Axios from Axios module.
Now, semicolon and it's done.
So now we're facing a deadline to have its cuts, right?
So let's just better data and to do that, we need Axios.
So Axios don't get this is going to fetch our data from our API.
Now if you're wondering, where is the API if you just see it, the assets folder that has been brought
to you, this is the API on which you are to make all this is.
Once you have copied, they become aware that they are study ethics and pay students ideal Axios to
get.
So here is Arabia now we're going to put that down, then disappear and then.
And insert this, then we are going to get that reserved.
And this reserve is going to be.
Against.
And this country's going to be stored data.
And now we're using the spirit operator to get all the details of our results, our.
Just data.
That cuts.
And now what about semicolon, no, right after dawn, then what do you need to do is that we are going
to call colors the random a function so well, say in accordance to the color, which is going to be
equal to this stirred random color.
Again, a semicolon.
Now we are going to change the value of our colors, right, so what they're going to do is that change
the value randomly because we won't assign random values, so we be directly updating our dorm so document.
The body.
Notes, though.
That color is going to be equal to our color.
Now, after this, they're going to change the background color as well, so document that.
Body style.
The background color.
Which is again going to be called white collar.
Now after this, you are going to change the state of our object, for example, I have gotten this
good data, so I'm going to it.
Assign this data to a state which again is an empty area.
And so let's just assign it to our state.
So this noted state.
Then again, this is going to be quarter data.
Would be.
Good.
Data.
So this really make sure that the color property even assigns of color because the color.
OK, so we have set up our state now we need to set up a get statement, which hopefully would be.
OK, so this is supposed to be a comma, not a semicolon, OK?
So now we need to set up a statement and then we'll be setting up a catch.
What if it doesn't go right, then what you need to do?
You will just be an agreement to get the error and go until all that data.
So let's just console.log this data.
You need to just step in C a g to get there, and they're going to look statements so.
So now we have said it a still matter that is going to fetch our data and assign it to US states.
So now there's another piece of code that we need to add, and that is going to be handled like whenever
I use a process that he or she needs in another code, we have to provide with an adequate right.
So that's what we're going to do.
So let's call as I make it into the matter and name it.