JavaScript/Variables/Exercises

Topic: Declaration and Initialization

{Which line(s) lead to an error? - Line 2 - Line 3 + Line 4 - Line 5 - None of the above
 * type="[]"}

{Which line(s) lead to an error? - Line 2 - Line 3 - Line 4 + Line 5 - None of the above
 * type="[]"}

{Which line(s) lead to an error? - Line 2 - Line 3 - Line 4 + None of the above
 * type="[]"}

{Which line(s) lead to an error? - Line 2 - Line 3 + Line 2 - Line 3 - Line 4 - None of the above
 * type="[]"}
 * The alert shows that the variable  does have a value of   does have a value of   does have a value of
 * type="[]"}

{Which line(s) lead to an error? - Line 2 - Line 3 - Line 4 - Line 5 + Line 6 - None of the above
 * type="[]"}


 * Be creative
 * 1) Explain to your colleague why programs need variables.
 * 2) Create a code snippet that defines a variable within a block scope. Access this variable within the block scope and outside of the block scope.
 * 3) Discuss with your colleague the advantages and disadvantages of using the global context.