Advertisement
Crevice

Primitive Data Type Exercises

Nov 5th, 2019
122
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. //TODO: MAKE SURE YOU LABEL YOUR CONSOLE LOGS!!!
  2. //create a variable called myName that contains
  3.    //your name in a string
  4. //console log myName
  5. //create a variable called favNumber that contains
  6.    //your favorite number
  7. //console log favNumber
  8. //create a variable called likesDogs that contains
  9.    // a boolean true if you like dogs and boolean false if you don't
  10. //console log likesDogs
  11. //IMPORTANT: for this section, only run your code when you reach the "RUN CODE NOW" below
  12. //make a variable called test1 that contains
  13.    //myName + favNumber
  14. //console log test1
  15. //make a code comment here with your hypothesis for the following
  16.    //what is the value in test1?
  17. //make a variable called test2 that contains
  18.    //myName + favNumber + favNumber
  19. //console log test2
  20. //make a code comment here with your hypothesis for the following
  21.    //what is the value in test2?
  22. //make a variable called test3 that contains
  23.    //favNumber + favNumber + myName
  24. //console log test3
  25. //make a code comment here with your hypothesis for the following
  26.    //what is the value in test3?
  27. //make a variable called test4 that contains
  28.    //myName + favNumber * favNumber
  29. //console log test4
  30. //make a code comment here with your hypothesis for the following
  31.    //what is the value in test4?
  32. //make a variable called test5 that contains
  33.    //likesDogs + favNumber
  34. //console log test5
  35. //make a code comment here with your hypothesis for the following
  36.    //what is the value in test5?
  37. //make a variable called test6 that contains
  38.    //likesDogs + myName
  39. //console log test6
  40. //make a code comment here with your hypothesis for the following
  41.    //what is the value in test6?
  42. //set variable myName equal to variable favNumber
  43. //make a code comment here with your hypothesis for the following
  44.    //what is the value in myName now?
  45.    //what is the value in favNumber now?
  46. //console log out myName and favNumber
  47. //set variable favNumber equal to variable myName
  48. //make a code comment here with your hypothesis for the following
  49.    //what is the value in myName now?
  50.    //what is the value in favNumber now?
  51. //console log out myName and favNumber
  52. //RUN CODE NOW
  53. //check your theories above to see if they match reality.
  54.    //how did your theories differ? Why?
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement