title: How to filter the strings without using regex?
body: <p>I'm filtering the array of strings with a matching character. The task is to get the strings with the character &quot;o&quot; from first part of the word.</p>
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>const fruits =["apple orange", "Orange", "banana", "banana", "apple"]
  
  const character = "o"
  
  const filterdFruits = fruits.filter((item) =&gt; item.charAt(0).toLowerCase() === character.toLowerCase())
  
  console.log(filterdFruits)</code></pre>
  </div>
  </div>
  </p>
  <p>The above logic will return the character matching with first letter of the string, which is Orange. But what I'm expecting here is to include Orange, apple orange as part my answer. There is  reason why I want Orange to be in first place as it is an exact match and, while, apple orange is also a match but not an exact match. I'm reluctant to use regex here as I have the tendency to go wrong. Happy to get some directions :)</p>