📊
Original Text
Modified Text
Differences
-function calculateTotal(price, tax) {
- return price + tax;
+function calculateTotal(price, tax, discount = 0) {
+ const subtotal = price + tax;
+ return subtotal - discount;
}
-const total = calculateTotal(10, 2);
-console.log(total);
+const total = calculateTotal(10, 2, 1);
+console.log("Total is:", total);