New JavaScript Debugging Exercises

Launch School
Aug 28, 2018 · 3 min read

We are happy to announce that Launch School has added two new sets of debugging exercises to our ‘JavaScript Language Fundamentals’ and ‘JavaScript Small Problems’ exercises, both of which are part of our JavaScript fundamentals course — Computational Thinking and JavaScript Programming.

Why Debugging Exercises?

You may be wondering what the value is in solving debugging exercises. What are they and how do they help you learn?

Launch School’s debugging exercises provide some existing code such as a function or a small program, as well as information about the intended behavior of the code. Sometimes the provided code raises an exception; often the bug is more insidious. The student’s task is to hunt down the bug and use their knowledge of core JavaScript concepts to implement a fix.

One obvious benefit of solving this type of exercise is gaining experience picking apart code that someone else has written. Many student programmers spend a large amount of time with their own code, but very little time reading and working with existing code written by others. Being able to read and understand others’ code is an invaluable skill when you get your first programming job and must work on a team, or when you want to make your first open-source software contribution.

Just like the rest of Launch School’s core curriculum, our JavaScript debugging exercises aim primarily to strengthen students’ mastery of the fundamentals. The lure of popular JavaScript frameworks is tempting, and many beginning programmers become distracted by the idea of building something exciting with the latest framework before investing the time to gain a true mastery of the language itself. This mindset leaves beginners vulnerable to common pitfalls and JavaScript ‘gotchas’, which may ultimately result in buggy code that is both frustrating and difficult to fix. Launch School’s debugging exercises provide an opportunity for hands-on experience encountering and correcting these common pitfalls, so that students may gain a deeper understanding of the JavaScript language and avoid such problems in their own code.

Let’s examine some very brief code samples.

Do you know how the output of the following two code snippets will differ? Can you explain why?

There is a bug in the below code preventing the factors of 18 from being displayed accurately. Can you spot it?

Even those who have prior programming experience in another language should take time to familiarize themselves with the particulars of JavaScript when they first begin to use it. Take a look at the two code snippets below. Notice that the identical code on line 3 of each snippet returns true in Ruby, but false in JavaScript.

The above examples touch on basic concepts that any aspiring JavaScript whiz should master before adding layers of abstraction such as libraries and frameworks to their code. A true mastery of the JavaScript language allows you to understand the why behind a program’s unexpected behavior, and to address the issue in your code logically and with purpose. Conversely, gaps in one’s knowledge of the fundamentals will likely lead to buggy code and a great amount of frustration as the developer attempts to figure out how to fix the problem without truly understanding why the problem occurred in the first place. Mastery of the fundamentals may require a bit more time initially, but it will pay off in spades as your ability to tackle larger and more complex problems with clean, maintainable code advances.

Learn More

If you’re new to Launch School and want to learn more, take some time to read about why we focus on Mastery-Based Learning. Registered members of the Launch School community can view all of our JavaScript exercise sets at

Launch School

Medium is an open platform where 170 million readers come to find insightful and dynamic thinking. Here, expert and undiscovered voices alike dive into the heart of any topic and bring new ideas to the surface. Learn more

Follow the writers, publications, and topics that matter to you, and you’ll see them on your homepage and in your inbox. Explore

If you have a story to tell, knowledge to share, or a perspective to offer — welcome home. It’s easy and free to post your thinking on any topic. Write on Medium

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store