```
var main = {
   doSomething: function(){
      function firstOne(){}
      function secondOne(){
         $.ajax({
            success: function(){
               firstOne(); /* here I want the previous function */
            }
         });
      }
   }
}

```

How can I run the firstOne() function from the marked line? It's a noobish question perhaps, but I don't get the JS namespace (and I tried).

Is that kind of defining functions good from a JS good practices point of view?