Strange structure, what does it mean?
<p>I'm a comer at JavaScript, and just learning some basic stuff (function, variable, etc) and I don't know so much about complex structure in JavaScript.</p>

<p>When I read the source code of one of the web applications, there is a big point that I cannot understand. Here's the code :</p>

<pre><code>Helper.using('py.Figures' , function (ns) {
    ns.Point = function (params) {
        ns.Figure.call(this, params);
        this.setType('Point');

        this.visual(new Kinetic.Circle({
            radius:5, strokeWidth:2,
            fill:'red', stroke:'black',
            draggable:false
        }));

        this.getX = function () {
        };
        this.getY = function () {
        };
        this.getPosition = function () {
            return {
                x:this.getX(), y:this.getY()
            }
        }

        ns.Point.distance = function (p1, p2) { // some code }

        ns.MidPoint = function (params)  { // some code }       
};
</code></pre>

<p>1) First point that I don't know in above code is the first line declaration : </p>

<pre><code>Helper.using('py.Figures' , function (ns) {... } );
</code></pre>

<p>Many files in this document use this structure. In this document, there is a file name <code>Helper</code>, but when I search in this document, I don't see some thing like <code>py.Figures</code> (by using Control + F). So, what does it really points to?</p>

<p>Above line looks something like a function, so what does <code>function(ns)</code> mean in this, it looks like parameter, but I don't think so.</p>

<p>2) The second point I don't know is :</p>

<p><code>ns.Point</code>, <code>ns.Point.distance</code>, <code>ns.MidPoint</code> look like methoda. So, <code>function(ns)</code> is a class, right ? And if <code>ns.Point</code> is a method, why in this method, there are other methods like <code>getX</code> and <code>getY</code> and it makes me feel that those look like a class too.</p>

<p>Sorry if my question is silly, but this code looks strange to me, and I don't see anything  familar with some language I have learnt (Java, C#), or another scripting language too (Python)</p>

<p>Thanks.</p>
