Jquery sorting by user entered text
<p>Is there a way to sort a array of names by a value that a user provides.</p>

<p>eg.</p>

<pre><code>names = ['Tom', 'John', 'Sam', 'Jane']
</code></pre>

<p>if the user then enters the name 'Sam' the array should change to:</p>

<pre><code>names = ['Sam', 'Tom', 'John', 'Jane']
</code></pre>

<p>also is it possible to sort where a name contains a certain word like 'Samuel' also contains
the word 'Sam'</p>
