Guest User

Untitled

a guest
Dec 11th, 2018
112
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.43 KB | None | 0 0
  1. Debugging: Use the JavaScript Console to Check the Value of a Variable
  2.  
  3. Use the console.log() method to print the value of the variable a where noted in the code.
  4.  
  5. let a = 5;
  6. let b = 1;
  7. a++;
  8. // Add your code below this line
  9. console.log(a);
  10.  
  11. let sumAB = a + b;
  12. console.log(sumAB);
  13.  
  14.  
  15. Debugging: Understanding the Differences between the freeCodeCamp and Browser Console
  16.  
  17. Use console.log() to print the variables in the code where indicated.
  18.  
  19.  
  20. // Open your browser console
  21. let outputTwo = "This will print to the browser console 2 times";
  22. // Use console.log() to print the outputTwo variable
  23. console.log(outputTwo);
  24.  
  25. let outputOne = "Try to get this to log only once to the browser console";
  26. // Use console.clear() in the next line to print the outputOne only once
  27. console.clear();
  28.  
  29. // Use console.log() to print the outputOne variable
  30. console.log(outputOne);
  31.  
  32.  
  33. Debugging: Use typeof to Check the Type of a Variable
  34.  
  35. Add two console.log() statements to check the typeof each of the two variables seven and three in the code.
  36.  
  37. let seven = 7;
  38. let three = "3";
  39. console.log(seven + three);
  40. // Add your code below this line
  41. console.log(typeof seven);
  42. console.log(typeof three);
  43.  
  44.  
  45. Debugging: Catch Misspelled Variable and Function Names
  46.  
  47. Fix the two spelling errors in the code so the netWorkingCapital calculation works.
  48.  
  49. let receivables = 10;
  50. let payables = 8;
  51. let netWorkingCapital = receivables - payables;
  52. console.log(`Net working capital is: ${netWorkingCapital}`);
Add Comment
Please, Sign In to add comment