Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Debugging: Use the JavaScript Console to Check the Value of a Variable
- Use the console.log() method to print the value of the variable a where noted in the code.
- let a = 5;
- let b = 1;
- a++;
- // Add your code below this line
- console.log(a);
- let sumAB = a + b;
- console.log(sumAB);
- Debugging: Understanding the Differences between the freeCodeCamp and Browser Console
- Use console.log() to print the variables in the code where indicated.
- // Open your browser console
- let outputTwo = "This will print to the browser console 2 times";
- // Use console.log() to print the outputTwo variable
- console.log(outputTwo);
- let outputOne = "Try to get this to log only once to the browser console";
- // Use console.clear() in the next line to print the outputOne only once
- console.clear();
- // Use console.log() to print the outputOne variable
- console.log(outputOne);
- Debugging: Use typeof to Check the Type of a Variable
- Add two console.log() statements to check the typeof each of the two variables seven and three in the code.
- let seven = 7;
- let three = "3";
- console.log(seven + three);
- // Add your code below this line
- console.log(typeof seven);
- console.log(typeof three);
- Debugging: Catch Misspelled Variable and Function Names
- Fix the two spelling errors in the code so the netWorkingCapital calculation works.
- let receivables = 10;
- let payables = 8;
- let netWorkingCapital = receivables - payables;
- console.log(`Net working capital is: ${netWorkingCapital}`);
Add Comment
Please, Sign In to add comment