title: Node.js - Object.getPrototypeOf
body: <p>I am trying to set the prototype of an object.</p>
  
  <p>However, sometimes I want to set/get the prototype of a string. Surprisingly, however, I get an error when I call:</p>
  
  <pre><code>var foo = 'baz';
  Object.getPrototypeOf(foo);
  </code></pre>
  
  <p>It throws:</p>
  
  <pre><code>TypeError: Object.getPrototypeOf called on non-object
      at Function.getPrototypeOf (native)
  </code></pre>
  
  <p>Why is that, and how can I get around it?</p>
  
  <p>I want to be to able to set and get the prototype of a string. The one weird thing is that I can do this without an error:</p>
  
  <pre><code>var myProto = {};
  
  var foo = 'baz';
  Object.setPrototypeOf(foo,myProto);
  </code></pre>