I was Working on this assignment for class and saw the exisiting JS code got the Html input value by calling the Id in the Parameter instead of storing it as variable. Im kinda Confused by this.
Html
<div>
<label for="type">Customer Type:</label>
<select id="type">
<option value="reg">Regular</option>
<option value="loyal">Loyalty Program</option>
<option value="honored">Honored Citizen</option>
</select>
</div>
<div>
<label for="subtotal">Invoice Subtotal:</label>
<input type="text" id="subtotal">
</div>
JS
const calculateDiscount = (customer, subtotal) => {
if (customer == "reg") {
if (subtotal >= 100 && subtotal < 250) {
return .1;}