Is there a good way to freeze an array of objects in Javascript?
<p>So I have a Javascript module that looks like the following:</p>

<pre><code>const data = [
     {
          id: 'do not modify',
          name: 'do not modify'
     },         
     {
          id: 'do not modify 2',
          name: 'do not modify 2'
     }
];

export default data;
</code></pre>

<p>Is there a clean way I can recursively freeze all objects in an array without explicitly calling <code>Object.freeze()</code> on each and every object?  I realize I could just loop through the array and freeze each of them before exporting, but I was curious to know if there was a more elegant solution.</p>