JavaScript Review
Question 1
calculateLetterGrade(96) returns a value because it is assigned to a variable. submitFinalGrade does not return anything.
Question 2
A global variable can be used anywhere in the program. A local variable only exists inside the function where it is created.
Question 3
Global: stateTaxRate, federalTaxRate. Local: wages, totalStateTaxes, totalFederalTaxes, totalTaxes.
Question 4
The program crashes because sum is a local variable inside the function and does not exist outside of it.
Question 5
True — all prompt input is a string.
Question 6
parseInt()
Question 7
parseFloat()
Question 8
It uses = instead of == or ===. = assigns a value instead of comparing.
Question 9
The value of x will be 20.
Question 10
Stepping over runs a function without going inside. Stepping into goes inside and shows each line running.