Skip to content

Latest commit

 

History

History
17 lines (14 loc) · 1.64 KB

Task1.md

File metadata and controls

17 lines (14 loc) · 1.64 KB

In this task, you will using the console inspector to explore variables and Javascript. Please follow the instructions below-if you get stuck, ask!

  1. In class, you looked at how to access the console of a web browser. Do so now, and make sure it is blank (you may need to open up a blank web page to do this). undefined
  2. In the console, type let myName = "<your name>" and press Enter. What response does the console return? ____undefined ________(enter response here)
  3. You've made your first variable! To recall the variable, type myName and hit Enter. Did you get what you expected?
  4. Now change the value of the variable to by typing myName = <new value> and hit Enter. Try to get back the new value. Try changing it to a letter, number, null or even true or false (what do you call these?).
  5. Restore the variable to its original value. Create another variable with any name you choose. However, instead of using let, use the word const. Retrieve the value as before.
  6. With your new variable, try to change the value. What happens? Why might this be important?
  7. Create a JS file. You can name it as you wish, making sure it ends with .js. Place the variables you created there.
  8. Back to the console, create numerical variables and try to add, subtract, multiply and divide them. Take one of the variable and try to divide by 0. Does your website crash?
  9. Going back to the first variables you created, set the variable of your first variable, to the second variable. To do this, type myName = <yourSecondVariable>. Now try to change myName-is it possible? Why do you think so?

[X ] I have completed this task

Now complete Task 2.