How do I create a simple search function in javascript?
<p>I start with a short array of some schools and then I want to test if the value of an input matches one of these schools.
Here is my code thus far:</p>

<pre><code>    var $schools = [
     'University of Tennessee-Knoxville',
     'Maryville College',
     'Cleveland State Community College',
     'East Tennessee State University'
    ];   
    var $searchBar = $('input.searchBar');
    $searchBar.keyup(function(){
         var $searchValue = $searchBar.val();
         for (var x = 0; x &lt; $schools.length; x++) {
             var $schoolLC = $schools[x].toLowerCase();
             var $searchLC = $searchValue.toLowerCase();
             var $searchingValue = new RegExp('.*' + $searchLC + '.*');
             if ($schoolLC.match($searchingValue)) {
                 console.log($searchLC);
             }
         }
     });
</code></pre>

<p>But something is obviously wrong (I believe with my RegExp), because it never console.logs the $searchLC.</p>

<p>Thanks so much!!</p>
