what's the meaning of this function in javascript?
<pre><code>function hasClass( elem, cls ) {
    var reClass = new RegExp(' ' + cls + ' ');
    return reClass.test(' ' + elem.className + ' ');
};
</code></pre>

<p>I am a newbie to javascript. I started to learn it today. I don't understand what the above function does, can somebody explain it to me? Thank you.</p>
