0

I have an array of 3 elements. I console log the array and then I updated the value of one element and console log the array. I can see both previous and updated arrays in the console. However, When I close my browser and open it again. I can see both updated arrays. Can anybody explain this weird behavior? It is only happening in chrome.

 const theArray = [
        "Wednesdays are sandwich club!",
        99,
        { name: "Kyrie", age: 31 },
      ];

      // 1. Retrieve the 2nd value in the array.
      theArray[1];
      console.log(theArray);

      // 2. Update the first value to `"Wednesdays are salad club!"`
      theArray[0] = "Wednesdays are salad club!";
      console.log(theArray);

Output when i close the browser and open it again

enter image description here

Gagan Deep
  • 33
  • 3

0 Answers0