How to Call this JavaScript Method which is Wrapped in a jQuery Function
<p>I am studying a JavaScript file and saw in it that some of the methods are wrapped inside a jQuery function. Can Anyone help me how to invoke the following method? And may I know what is the advantage or why the method is wrapped in a function? Below is my sample JavaScript code.</p>

<p><strong>JQuery/JavaScript</strong></p>

<pre><code>$(document).ready(function () {
    //How to invoke "testMethod" method?
    $(function () {
        function testMethod() {
            alert("this is a test method");
        }
    });
});
</code></pre>
