1 00:00:00,000 --> 00:00:04,849 [MUSIC] 2 00:00:04,849 --> 00:00:08,400 Welcome back, we've done some great work on our library app so far. 3 00:00:08,400 --> 00:00:11,960 We've declared three classes, library, patron, and book, and 4 00:00:11,960 --> 00:00:13,870 added their constructor methods. 5 00:00:13,870 --> 00:00:16,270 Now it's time to start adding some other methods. 6 00:00:16,270 --> 00:00:19,188 Our rough plan of attack included two methods on the library class, 7 00:00:19,188 --> 00:00:21,510 addBook() and addPatron(). 8 00:00:21,510 --> 00:00:24,580 These methods are our way of entering a new book or 9 00:00:24,580 --> 00:00:27,330 new patron into the library system. 10 00:00:27,330 --> 00:00:31,600 These methods will take an actual book or patron object and add it to the array of 11 00:00:31,600 --> 00:00:37,660 books and patrons stored in the library object's books and patrons properties. 12 00:00:37,660 --> 00:00:38,630 Let's start with addBook(). 13 00:00:39,810 --> 00:00:43,480 It makes sense that the addBook() method should receive the book that's being added 14 00:00:43,480 --> 00:00:44,750 as a parameter. 15 00:00:44,750 --> 00:00:46,960 We can pass in an entire book object, 16 00:00:46,960 --> 00:00:50,590 like the one we created earlier that's representing a Harry Potter book. 17 00:00:50,590 --> 00:00:55,060 Then we just need to add the book object to the array stored in the library's books 18 00:00:55,060 --> 00:00:58,370 property using a simple array method like push. 19 00:00:58,370 --> 00:01:00,520 This can be a simple, one-line method. 20 00:01:00,520 --> 00:01:03,370 addPatron() will work exactly the same way. 21 00:01:03,370 --> 00:01:06,500 Open up the attached workspace to find an updated read me file with 22 00:01:06,500 --> 00:01:07,870 new instructions. 23 00:01:07,870 --> 00:01:10,630 If you'd like to continue working in your existing workspace, 24 00:01:10,630 --> 00:01:12,880 check out the teacher's notes for the new directions. 25 00:01:12,880 --> 00:01:14,010 Once you're done, or 26 00:01:14,010 --> 00:01:17,440 if you need some help, check out the solution following this video. 27 00:01:17,440 --> 00:01:19,860 Then we'll join back up to test out our new methods.