A short lecture on some JavaScript basics should take place before working on the solutions to these bugs.
Run npm test
and notice all the test failures. Start at bug-1
and fix the failure so the test passes. Use the JS knowledge you've gained through the lecture (or from prior knowledge) to solve the problems. Rerun npm test
to see the passes increase and failures decrease.
If you are having issues, you can run the *.fix.js
file as a regular Node app, which means you can also run it in debug more, or put some console.log
statements in there ... just write node <filename>
to run it as a Node app or use your IDE's debug server to run it and use breakpoints.
There are the final solutions in the solutions branch, so git checkout solutions
to find how they can be solved. Remember that these are contrived examples that could possibly have dozens of solutions. The ones you see here are just mine :)
Once you have all green in your tests, try to optimize the code to make it better.