Tell us what’s happening:
I did the right solution yet I can not pass the test.
Your code so far
function freezeObj() {
'use strict';
const MATH_CONSTANTS = {
PI: 3.14
};
// change code below this line
object.freeze(MATH_CONSTANTS);
// 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/79.0.3945.88 Safari/537.36.
Challenge: Prevent Object Mutation
Link to the challenge:
https://www.freecodecamp.org/learn/javascript-algorithms-and-data-structures/es6/prevent-object-mutation