title: Freezing the elements of an array
body: <p>I have an array of certain primitive elements:</p>
  
  <pre><code>const array = [1, 2, 3]
  </code></pre>
  
  <p>I want to be able to temporarily <strong>freeze an element of this array</strong> and prevent it from being modified. But the moment the element can be allowed to be modified, there should be a way to unfreeze the value.</p>
  
  <p>Is there a way to do so?</p>
  
  <p><strong>Off-topic for those who flag this question as duplicate:</strong></p>
  
  <p>The question is about freezing the elements of an array, not the entire array. It is not a duplicate of a question regarding freezing the entire array.</p>