function getTotal(a, b) {
console.log(a + b);
}
getTotal('10', '20');function getTotal(a, b) {
console.log(Number(a) + Number(b));
}
getTotal('10', '20');Bug: When either operand of + is a string, JS converts the other to a string and concatenates. "10" + "20" = "1020".
Explanation: Number() converts strings to numbers first. Then + performs numeric addition.
Key Insight: + prefers string concatenation when either operand is a string. Always explicitly convert with Number() when you need addition.