JavaScript Algorithms and Data Structures Projects - Prevent Object Mutation

Hi there,

I dont now why this code doesn’t ask the task. Can anyone help me?

Object.freeze(MATH_CONSTANTS);

function freezeObj() {
  const MATH_CONSTANTS = {
    PI: 3.14
  };
  // Only change code below this line
Object.freeze(MATH_CONSTANTS);
console.log();

  // Only change code above this line
  try {
    MATH_CONSTANTS.PI = 99;
  } catch(ex) {
    console.log(ex);
  }
  return MATH_CONSTANTS.PI;
}
const PI = freezeObj();

Thank you but i found the issue. :wink:

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.