console.log()
and typeof
methods are the two primary ways to check intermediate values and types of program output. Now it's time to get into the common forms that bugs take. One syntax-level issue that fast typers can commiserate with is the humble spelling error.
Transposed, missing, or mis-capitalized characters in a variable or function name will have the browser looking for an object that doesn't exist - and complain in the form of a reference error. JavaScript variable and function names are case-sensitive.
netWorkingCapital
calculation works.
receivables
variable should be declared and used properly in the code.
testString: assert(code.match(/receivables/g).length == 2, 'The receivables
variable should be declared and used properly in the code.');
- text: There should be no instances of mis-spelled variables in the code.
testString: assert(!code.match(/payable;/g), 'There should be no instances of mis-spelled variables in the code.');
- text: The payables
variable should be declared and used properly in the code.
testString: assert(code.match(/payables/g).length == 2, 'The payables
variable should be declared and used properly in the code.');
```