(You should be able to clone this gist and run node example[x].js for each JS file here to do the exercises).
- What do you think will happen when you execute
example1.js? - What happens if you comment out line 12 and run
example1.js? Why? - What do think will happen when you execute
example2.js? Did it work as you expected? - What would happen if you added a new line to the end of
example3.jsandconsole.log(mySecretValue);? Why? - What type is
secretKeeperon line 12 ofexample4.js? How did it get assigned? - What code does
secretKeeper()execute when it is invoked on line 13 ofexample4.js? What does it return and how? - What type is
secretas of line 13 ofexample4.js? - What will log to the
consolein line 14 ofexample5.js? Line 15? - What is the lifecycle of
mySecretValueinexample5.js? How and when does it change value?