title: How does subtraction operator trigger an array-to-number conversion?
body: <p>Here are 2 examples of my code. The first one is:</p>
  <pre><code>console.log([4] + 10); //&quot;410&quot; 
  </code></pre>
  <p>As far as I know, addition operator can work only with numbers and strings. So, firstly, <code>[4]</code> should be transformed into the number or string. When trying to convert an operand to a primitive data type, either <code>valueOf()</code> or <code>toString()</code> runs. By default, <code>valueOf()</code> returns an array, so this method is ignored. <code>toString()</code> is invoked. It converts the complex data type to a string. That's completely understandable for me, but...</p>
  <p>What's going on in the second example?</p>
  <pre><code>console.log(10 - [4]); //6 
  </code></pre>
  <p><strong>I don't get how <code>valueOf()</code> can transform array into the number if this method by default returns an array. What does occur here?</strong></p>