ES6 - Prevent Object Mutation

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


  // Only change code above this line
  try {
  } catch(ex) {
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/ Safari/537.36

Challenge Information:

ES6 - Prevent Object Mutation

What error are you getting?

it doesn’t accept it and pass me!

Please talk about what specifically the error message is and what you have tried to fix your code.

1 Like

To ensure your data doesn’t change, JavaScript provides a function Object.freeze to prevent data mutation.

Hint: Capital O

ReferenceError: object is not defined

it shows this error :
ReferenceError: object is not defined

Ok, so double check the syntax. Capitalization matters. Did you type Object or object?

1 Like