It’s the error that is thrown when the code tries to execute the following line:
MATH_CONSTANTS.PI = 99;
Since you added Object.freeze(MATH_CONSTANTS) you can no longer change the value in the MATH_CONSTANTS object. When you attempt to do that an error is thrown and caught in the catch block, which executes any code in that block (in this case, printing the error to the console). You are just seeing the error that it is printing to the console.
Yes, try { MATH_CONSTANTS.PI = 99; } block tried to reassign the PI key from the frozen object since it was frozen it throws an error. That error is then passed to catch(error) { console.log(error) } this will log the caught error you can do other logic in that catch block though,
catch(error){
console.log(error)
window.alert("PI is a mathematical constant and never changes");
}