Prevent Object Mutation III

Prevent Object Mutation III
0

#1

Even after copy & pasting the answer, it’s throwing an error. I’ve clicked reset, then refreshed the browser, then restarted the browser and eventually restarted the whole system.

One of my first wrong guesses was to freeze the function instead of the object, could the cache be holding onto that in some way?

CaptureObjectMutation

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:
Chrome
User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/68.0.3440.106 Safari/537.36.

Link to the challenge:
https://learn.freecodecamp.org/javascript-algorithms-and-data-structures/es6/prevent-object-mutation


#2

Try cleaning and clearking your cookies and caches or a different browser.


#3

I just did that, was already thinking of it. But wanted to log the process first.
Console still logs an error as I paste the answer back in, but it does accept it after I click the run button

CaptureObjectMutation