From the course: Computer Science Principles Lab: JavaScript

Unlock the full course today

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

Break down tasks

Break down tasks - JavaScript Tutorial

From the course: Computer Science Principles Lab: JavaScript

Start my 1-month free trial

Break down tasks

- [Instructor] Everything we do in coding happens literally. If it doesn't exist in code, it isn't going to happen. So when we think about the steps we take in our programming, we have to break things down to every granular step that is defined by a line of code. In javascript, we can think of these steps as two things. Each individual line of code is considered a step. While a function is considered a grouping. If we look at the code here, we can use these to walk through what we are doing. At the start, we have a step. First, I need to define that we will have a score in our program. Then, you have two function calls which you could say like this. I initialize the values that are in the game, and then I change the game score. But, while this is what happens in the game, it isn't very descriptive, and it lacks the steps that are necessary to go through everything. In this case, we could break these down into individual steps that are all located within the functions. So, we could…

Contents