title: Strings are not object then why do they have properties?
body: <p>Code like this:</p>
  
  <pre><code>var str = "Hello StackOverflow !";
  alert(typeof str);
  </code></pre>
  
  <p>gives me <code>string</code> as result. This means strings are not objects, <strong>then why do we have properties of a string <code>str</code> like <code>str.substring</code>, <code>str.indexOf etc.?</code></strong>
  Also when i set property to it as</p>
  
  <p><code>str.property = "custom property is set";</code> and trying to get this <code>alert(str.property)</code>, it gives me <code>undefined</code>. Why?</p>