From the course: Learning JavaScript Debugging

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Solution: Other people's code

Solution: Other people's code - JavaScript Tutorial

From the course: Learning JavaScript Debugging

Start my 1-month free trial

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…

Contents