Typescript String Comparison Oddity with String.toLowerCase
<p>while curious (and no JS background) I'm beginning to dive into Typescript and face a brick wall.
I want to compare two strings and to make life easy they will be aligned to lowercase first. This is the code:</p>

<pre class="lang-js prettyprint-override"><code>let bool: boolean = false;
let i = 0;
this.comparisons[++i] = " init bool " + " =&gt; " + bool;

bool = false;
if ("a" == "a") { bool = true };
this.comparisons[++i] = ' "a" == "a" ' + " =&gt; " + bool;

bool = false;
if ("a" == "b") { bool = true };
this.comparisons[++i] = ' "a" == "b" ' + " =&gt; " + bool;

bool = false;
if ("a" == "A") { bool = true };
this.comparisons[++i] = ' "a" == "A" ' + " =&gt; " + bool;

bool = false;
if ("a".toLowerCase == "A".toLowerCase) { bool = true };
this.comparisons[++i] = ' "a".toLowerCase == "A".toLowerCase ' + " =&gt; " + bool;

bool = false;
if ("a".toLowerCase == "B".toLowerCase) { bool = true };
this.comparisons[++i] = ' "a".toLowerCase == "B".toLowerCase ' + " =&gt; " + bool;
</code></pre>

<p>and it prints:</p>

<pre><code>init bool =&gt; false

"a" == "a" =&gt; true

"a" == "b" =&gt; false

"a" == "A" =&gt; false

"a".toLowerCase == "A".toLowerCase =&gt; true

"a".toLowerCase == "B".toLowerCase =&gt; true
</code></pre>

<p>Why does the last expression evaluate to true?</p>

<p>"a" == "b" should evaluate to false like the third statement.</p>