Question: The code that follows has a bug in it because the second use of the variable named salesTax is spelled with all lowercase letters (
The code that follows has a bug in it because the second use of the variable named salesTax is spelled with all lowercase letters salestax
var calculateTax functionsubtotaltaxRate
var salesTax subtotal taxRate;
salestax parseFloatsalesTaxtoFixed;
return salesTax;
Assuming that there are no other problems and that youre using strict mode, what will happen when this code is executed?
The code that follows has a bug in it because the second use of the variable named salesTax is spelled with all lowercase letters salestax
var calculateTax functionsubtotaltaxRate
var salesTax subtotal taxRate;
salestax parseFloatsalesTaxtoFixed;
return salesTax;
Assuming that there are no other problems and that youre using strict mode, what will happen when this code is executed?
salestax will contain the rounded sales tax value
an error will occur because salestax hasnt been declared
salesTax will contain null when it is returned
salesTax will contain the right value, but it wont be rounded
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
