How to pass arguments inside function?
<p>I started to learn Jquery and but I am having trouble understanding function parameters:(
If you look my <b>first</b> code and run it: my script <b>WILL work</b> <i>(WITHOUT parameters)</i>. And if you look my <b>second</b> code <br/><i>(WITH parameters)</i> and run it: <b>second script</b> <i>WILL ALSO WORK!!</i><br/> <br/>My first question: Did I correctly <b>set</b> parameter in my <b>second script?</b><br/>Second question: How can I <b>check</b> is my parameter <b><i>set</i></b> or being  <b><i>passed correctly</i></b> to my function?
<br/>P.S. Sorry for being NOOB and <b>THANK YOU!!</b> </p>

<pre><code>   //First code (WITHOUT PARAMETERS!!!) 
   $(document).ready(function () {
       var addclass = $('p:first');

       function AddClass() {
           addclass.addClass('first');
           if (addclass.is($('.first'))) {
               alert('here');
           }
           else {
               alert('not here');
           }
       }
       $('.button').click(function () {
           AddClass(addclass);
       });
   });
   //Second code (WITH PARAMETERS)
   $(document).ready(function () {
       var addclass = $('p:first');

       function AddClass(addclass) {
           addclass.addClass('first');
           if (addclass.is($('.first'))) {
               alert('here');
           }
           else {
               alert('not here');
           }
       }
       $('.button').click(function () {
           AddClass(addclass);
       });
   });
</code></pre>
