All right, I know what you're thinking, build the board already, so that's what we're going to do
in this lesson.
But before we do that, we need to output our solutions.
So we've got a word.
But this word is not within an array format.
And as we can see when we hit start, it's just a string value.
So before we conclude, we need to build this out within a string format so we can use the player object
and we can use a value like solution, take the word that we've got as a string value and we're going
to use the JavaScript method of split.
So what split does is it splits a string object into an array of strings by separating the string into
some strings.
So we need to specify how we want to split it.
So if you do the double quotes there without any space in there, if you add in a space that's going
to split, depending on how many spaces are and we don't have any spaces, so we don't want to split
by anything, we just want to split them all into separate each one of the characters into a separate
value in the array.
So outputting that instead of the word and updating the console output, we should now see an array
object with all of the characters that are available from our randomly selected item from our array.
And we can use this to loop through and show the player how many characters they need to solve.
And it also will help us as we loop through each one of those and selecting the different values within
the words.
So now we're ready to build our board.
That's what we're going to do as well.
So create a function to build the board and this will kick off the function called build board.
We're going to build out the visual part of our gameplay.
So now that our value is within array format, we can iterate through that array so we can use for each.
And iterating through each one of the items within that array, and these are all letters.
So I would put it as a letter value and now we can console logout letter if you want.
So you see that when I refresh and I hit start, you're going to see that we're outputting each one
of those letters.
So this is coming from that console message there on line thirty three.
We want to use our JavaScript and create some device.
So creating a div that we can add in those element values into the device.
So using create elements method in JavaScript, what it does is creates a specified elements in the
element that we want to create our device and then we can update that object.
So with class list, we can add to that class list.
So let's give it a class of letter and then we can update some of the success so we can output it.
Actually, we're going to update it and we'll call it letter two and then the other ones will be letter.
So the div and entire text of the div by default is just going to be underscore because we don't want
to show the player the solution quite yet, of course.
And within the div, we're going to add in a value for my letter.
So we're adding in a hidden object value because this div is a giant object.
So each one of the elements is an object and you can hide, add additional values into the object.
So we're creating one called my letter and we're adding the value of letter into it.
So we know when we select that element, we know what the value is.
We can also get it from the entire text, of course, but this way we can see what the value is supposed
to be and then selecting our output to we're going to attend a child.
And the child that we're spending is that div that we've just created.
And before we do that, this is an add.
It's actually decided that it so we see we've got each one of the spaces, the underscores for the solution
letter.
And this one is course we can see it within our console, of course.
So go ahead and add this into your project.
And next, we need to do a little bit of success to make it output in line.
So that's more visually represented for the player.
And then coming up next as well, we need to create an alphabet list that the player can select from
different letters, and then we're going to check them off to see if they're available within the solution.
So all of that is still yet to come.