title: JavaScript increment unary operator (++) on strings
body: <p>I am on Chromium Version 53.0.2785.143 Built on Ubuntu, running on Ubuntu 16.04 (64-bit)</p>
  
  <p>According to the <a href="http://www.ecma-international.org/ecma-262/5.1/#sec-11.4.4" rel="nofollow">ECMAScript® Language Specification</a>, prefix increment operator is evaluated as follows:</p>
  
  <p><img src="https://i.stack.imgur.com/08X8x.png" alt="Prefix Increment Operator evaluation steps"></p>
  
  <p>With this in mind, I cannot explain this result:</p>
  
  <pre><code>++'1';
  &gt; Uncaught ReferenceError: Invalid left-hand side expression in prefix operation
  </code></pre>
  
  <p>when the following code works like a charm:</p>
  
  <pre><code>var x = '1'; 
  ++x;
  &gt; 2
  </code></pre>
  
  <p>As far as I understand, in both cases the first 3 bullet points of the second step are true, whereas for <code>++'1'</code> case the fourth bullet is also true (but why?) and for the <code>++x</code> case it is false, raising no error. Am I right?</p>
  
  <p>PS: Firefox throws a <code>SyntaxError: invalid increment operand</code> instead of a <code>ReferenceError</code></p>