Gets the sales tax rate for a given US state code.
The 2-letter state abbreviation (e.g., 'CA', 'TX').
The sales tax rate as a percentage, or undefined if not found.
undefined
const rate = getTaxRateByState("TX");console.log(rate); // Output: 6.25 (if defined in stateTaxRates) Copy
const rate = getTaxRateByState("TX");console.log(rate); // Output: 6.25 (if defined in stateTaxRates)
Gets the sales tax rate for a given US state code.