--description--
The 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 miscapitalized 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.
--instructions--
Fix the two spelling errors in the code so the netWorkingCapital
calculation works.
--hints--
Check the spelling of the two variables used in the netWorkingCapital calculation, the console output should show that "Net working capital is: 2".
assert(netWorkingCapital === 2);
There should be no instances of misspelled variables in the code.
assert(!__helpers.removeJSComments(code).match(/recievables/g));
The receivables
variable should be declared and used properly in the code.
assert(__helpers.removeJSComments(code).match(/receivables/g).length == 2);
There should be no instances of misspelled variables in the code.
assert(!__helpers.removeJSComments(code).match(/payable;/g));
The payables
variable should be declared and used properly in the code.
assert(__helpers.removeJSComments(code).match(/payables/g).length == 2);
--seed--
--seed-contents--
let receivables = 10;
let payables = 8;
let netWorkingCapital = recievables - payable;
console.log(`Net working capital is: ${netWorkingCapital}`);
--solutions--
let receivables = 10;
let payables = 8;
let netWorkingCapital = receivables - payables;
console.log(`Net working capital is: ${netWorkingCapital}`);