Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started