Why can I use == in JavaScript but not in Java?
<p>I have two string in Java: </p>

<pre><code>String a = "ab";
String b = "ab";
</code></pre>

<p>And I test them with the <code>string.equals()</code> method because the <code>==</code> operator only checks whether the references to the objects are equal.</p>

<p>Why can I use <code>==</code> in JavaScript?</p>
