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 (salestax).
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 = function(subtotal,taxRate) { var salesTax = subtotal * taxRate; salestax = parseFloat(salesTax.toFixed(2)); return salesTax; }; Assuming that there are no other problems and that youre using strict mode, what will happen when this code is executed?
a.The salesTax variable will contain the right value, but it wont be rounded.
b.An error will occur because salestax hasnt been declared.
c.The salestax variable will contain the rounded sales tax value.
d.The salesTax variable will contain null when it is returned.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
