The code below stops with an uncaught error. Which statement correctly describes the problem?
"use strict";
function addBonus(salary) {
total = salary + 5000;
return total;
}
console.log(addBonus(30000));
Strict mode turns an assignment to an undeclared name into a ReferenceError instead of silently creating a global. const total = salary + 5000; fixes it.