title: Lowercase and Uppercase are the same JS
body: <p>I am creating a program that will pull up the first non repeated word within a string. While doing this I bump into a logic problem where I need to count a word in uppercase and lowercase the same but still returns the original uppercase version of the string.</p>
  
  <p>Here's my codes:</p>
  
  <pre><code>function firstNonRepeatingLetter(str) {
   // split the array and transform it to lowercase
   str = str.split('');
  
   // create an obj that will hold the counter of each characters
   let myObj = {};
  
   // create a new arr for all the char w/ 1 value
   let uniq = [];
  
   // iterate through the splitted array
   str.forEach((char) =&gt; {
      // if the obj contains the same key (char)
     if(myObj.hasOwnProperty(char)){
        // we add 1 to its value
       myObj[char]++;
     }else{
        // otherwise we set the key value to 1 
       myObj[char] = 1;
     }
   });
  
   // check the obj with 1 value, 
   for(let prop in myObj){
    // and then push the key inside a 
     // new arr with only 1 counter
     if(myObj[prop] === 1){
       uniq.push(prop);
     }
   }
  
   console.log(myObj);
  
   // return the first elem in the arr
   return uniq.length !== 0 ? uniq[0] : '';
  }
  
  firstNonRepeatingLetter('sTress') // =&gt; must return 'T' instead return 't'
  firstNonRepeatingLetter('NecEssarY') // =&gt; must return 'N' instead return 'n'
  </code></pre>
  
  <p>The object looks like this: <code>{ N: 1, e: 1, c: 1, E: 1, s: 2, a: 1, r: 1, Y: 1 }</code>it counts the 'N' and 'n'separately.</p>
  
  <p>Any idea how to retain the actual case without affecting the functionality?</p>
  
  <p>Thanks!</p>