Before we create our CSP file, we're going to need some data.
So let's set up a variable and this is going to be an array and it's going to have multiple arrays inside
of it.
So it's an array and it's going to have arrays within it.
And the way that CSV files work typically is that they've got maybe a title for the data.
So within the heading, that's going to be the first row and then the next item in the array is going
to be the next row.
So we'll have multiple rows so this can be rolled.
Of course you can add in content as needed.
If you add in if you want more columns, you can do that as well.
And these values can be anything as these are just some placeholder values that we have that are going
to be output into the file.
So once you've created the overall structure of the data, you can just make sure that it is it is proper.
When you output into the console, you can see you've got an array and a bunch of arrays within that
array.
And this is how the content is structured in preparation for the CSV file.
So next to that, we're are ready to do is to create a function where we can export the data into a
CSFI file.
So whenever the user clicks the CSP download CSV file, we want to trigger this function.
So creating a function, create CCSVI and then here's where we can passan data.
So if our data is ever changing, then we can always update and change that data.
So instead of console log, we can get rid of that and we're going to invoke passing in some data into
a function and we do have that data that we just created.
So let's pass that in.
And the reason I'm doing it this way is so that it's going to be more dynamic and console logs or log
out the data.
So that's all that function is going to do.
So we have something for the next lesson.
So let's do a quick refresh.
We click the button and we see the output of the data that we're passing in and we're going to build
our CSFI out.
So go ahead and add that into your project.
Set up some dummy default data as well as the function in order to handle the creation of the CSP file,
he could be ready to move on to the next lesson.
We're going to do all of the magic, all the magic is going to happen.
We're going to create the CSFI file all via JavaScript.
So that's still to come.