I used ObjectFreeze but it doesn#t works

Tell us what’s happening:

  **Your code so far**

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

  **Your browser information:**

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/88.0.4324.150 Safari/537.36.

Challenge: Prevent Object Mutation

Link to the challenge:

Hey @m.mouttaqui,

Next time please tell us what you are having an issue with so we can help. Anyways, your code work normally for me. Do you have any extension that might interfere with the FCC tests? Try to disable those, if problem still persist, try doing the problem in an incognito mode tab.

I have run it again, it worked

1 Like