title: Why does `x[0]` return a zero-length vector?
body: <p>Say I have a vector, for example, <code>x &lt;- 1:10</code>, then <code>x[0]</code> returns a zero-length vector of the same class as <code>x</code>, here <code>integer(0)</code>.</p>
  
  <p>I was wondering if there is a reason behind that choice, as opposed to throwing an error, or returning <code>NA</code> as <code>x[11]</code> would? Also, if you can think of a situation where having <code>x[0]</code> return <code>integer(0)</code> is useful, thank you for including it in your answer. </p>