Stucked here; reference error: object is not defined

Tell us what’s happening:
Describe your issue in detail here.

  **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/97.0.4692.99 Safari/537.36

Challenge: Prevent Object Mutation

Link to the challenge:

You should be careful about your orthography…

Change object.freeze to Object.freeze. ( big “O” no 0 )

2 Likes

did that and another [TypeError: Cannot assign to read only property ‘PI’ of object ‘#’]

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