课程: Code Clinic: JavaScript

今天就学习课程吧!

今天就开通帐号,24,600 门业界名师课程任您挑!

Storing board solutions

Storing board solutions

- [Instructor] So it's finally time to fire everything up, and then start to work with our interface to display some of our items here. So let's start out by saying let myBoard is going to be equal to this new board. So this is calling the method that we created that's going to generate a new board with all of the solutions, and then we're gonna start out by initializing. So myBoard, tryNewQueen, which is the method that fires everything up. And then we're gonna get the amount of solutions we get back from our board. So we'll say solutions quantity is going to be equal to myBoard solutions length. So that's gonna start the board, calculate all the solutions, and then give that back to us in a variable. Once we have that then we can start filling out how our interface displays those elements. So we'll say document querySelector. We're gonna target here the element called currentSolution, inner, and change the HTML of the current solution to one. So what that's gonna do is sort of…

内容