
In the example above, notice that for the variable listitem, the i was not capitalized in item. Highlighting: Highlights on specific parts let us know if a character or word is different between the files. Minus and plus signs: Just like the colors, the minus signs show what lines need to be removed and the plus signs show what lines need to be added. Red indicates the lines that contain code that need to be removed, and green indicates the lines that contain things that need to be added. Here are the three things that can tell you what you need to change in order to make your code the same as the solution:Ĭolors: The first thing you’ll notice is that the code that’s different from the solution is shown in red, while the solution code is shown as green. Note: It’s ok if you’re not familiar with JavaScript, you don’t need to know it in order to understand how this works. On the left, the code you’ve written in main.js.Here’s what it looks like to use the Codecademy solution diff tool: On Codecademy, we use diffing to show you the differences between the code that you’ve written in the lesson workspace and the final solution code. Or, we could be comparing our code versus someone else’s code.


Most often, we’re using diff tools when comparing two different versions of the same code, usually an older version and a newer version. Diff tools, short for difference, allow programmers to look at the two files side by side and see exactly what differentiates them-where new lines of code have been added if variable names have been changed or if any lines of code have been removed. When we’re writing code, sometimes we want to compare two similar but different files.
