Namespaces


var myNS = myNS || {}; 
myNS.myFunction = function() {
   return "text";
};

Nested Namespace

var myNS = myNS || {}; 
var myNS.mySubNS = myNS.mySubNS || {};
myNS.mySubNS.myFunction = function() {
   return "text";
};



( function (ns) { 
   var something = "text";
  
   ns.myFunction = function() {
      return "text";
   }
}) ( window.myNS = window.myNS || {} );




© 2020 Better Solutions Limited. All Rights Reserved. © 2020 Better Solutions Limited TopPrevNext