title: Code wars: Why does this function work against whitespace and numbers?
body: <p>I need to check if two strings are in the same case. I have my own solution to this problem but I found this version and I can't understand how/why it works:</p>
  <pre><code>function sameCase(a, b){
   if(a.toUpperCase() === a.toLowerCase() || b.toLowerCase() === b.toUpperCase()){
      return -1
    }else if(a === a.toLowerCase() &amp;&amp; b === b.toLowerCase() || a === a.toUpperCase() &amp;&amp; b === b.toUpperCase()){
        return 1
    }else{
      return 0
    }
  }
  </code></pre>
  <p>Specifically this <code>if</code> statement:</p>
  <pre><code>if(a.toUpperCase() === a.toLowerCase() || b.toLowerCase() === b.toUpperCase()){ return -1}
  </code></pre>
  <p>I know this check works against numeric characters and white space, but I don't understand why this works since it doesn't look to take these items into account.</p>
  <p>my question: why does this function work against non-letters and numbers and even white space?</p>