title: 'Freezing' Arrays in Javascript?
body: <p>Since the ECMA-262 specifications Javascript has gained the <em>Object.freeze()</em> method, which allows for objects, whose properties can not be changed, added or removed.</p>
  
  <pre><code>var obj = {'a':1, 'b:2'};
  Object.freeze(obj);
  Object.isFrozen(obj);       // returns true
  obj.a = 10;                 // new assignment has no affect
  obj.a;                      // returns 1
  </code></pre>
  
  <p>So far so good.</p>
  
  <p>I am wondering, whether freeze() should also work on Arrays.</p>
  
  <pre><code>var arr = [1, 2];
  Object.freeze(arr);
  Object.isFrozen(arr);      // returns true
  arr[0] = 10;
  arr;                       // returns [10, 2] ... ouch!
  </code></pre>
  
  <p>Maybe I am wrong, but I was under the impression, that Array inherits from Object.</p>
  
  <pre><code>typeof obj                 // "object"
  typeof arr                 // "object"
  </code></pre>
  
  <p>Any ideas, pointers, enlightenments would be highly appreciated.</p>