Miss (Obj).Right?
But I write that code:
function freezeObj() {
“use strict”;
const MATH_CONSTANTS = {
PI: 3.14
};
// change code below this line
Object.freeze(obj);
// change code above this line
try {
MATH_CONSTANTS.PI = 99;
} catch( ex ) {
console.log(ex);
}
return MATH_CONSTANTS.PI;
}
const PI = freezeObj();
But tell me:
obj is not defined
obj is not defined
obj is not defined
obj is not defined
ok so the “obj” is not defined. That tells you that you are freezing something that doesn’t exist.
Refer back to the instructions for more help. I’ve pasted them here for you for convenience.
In this challenge you are going to use Object.freeze to prevent mathematical constants from changing. You need to freeze the MATH_CONSTANTS object so that no one is able alter the value of PI, add, or delete properties .