课程: JavaScript: Five Advanced Challenges and Concepts
免费学习该课程!
今天就开通帐号,24,700 门业界名师课程任您挑!
Solution: Create a library with books - JavaScript教程
课程: JavaScript: Five Advanced Challenges and Concepts
Solution: Create a library with books
(upbeat music) - [Instructor] In this challenge, we'll build out a basic library system. And although there's a lot of code here, you'll notice there's a very strong pattern to it. There's a lot of the same. And everything that you need to solve this challenge was covered in the previous movies in this chapter. Before I get started, let's take a quick look at the test code here 'cause this is important. So we're passing in three different books that have title, author, publishing year, and genre. Then further down, we're adding the books to the library. And you'll notice I've wrapped this in a console log, just so that you can see that the books are being added in the output. And finally, to test the capabilities, we are finding a book, and then we are removing a book. So in the challenge, we have to make all of that stuff work. And when you look at the commentary, you'll see we start by we have to extend the class with a…