课程: Learning JavaScript Debugging

今天就学习课程吧!

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

Solution: Other people's code

Solution: Other people's code

(electronic music) - [Instructor] Let's work through a solution to this other people's code challenge. First we're going to try shuffling and dealing a few times just to confirm that even though there's way too many cards, it does look like we're getting a variety here. So it's at least partially working. I don't see any duplicate cards. Some of them are getting hidden up here but it seems safe to say that we are not getting duplicates. And even though this is not working, giving us the right number of cards, there's at least some good in here. So we'll open up the developer tools and go to our debugger. Here's the cards.js file here. We know that we have a handler that takes care of shuffling and dealing. So let's go visit that and set a breakpoint. I'll click this and here we go. We're paused. The first thing that I want to do is confirm that the size of the deck that we're getting back is actually correct. So…

内容