How do I declare a namespace in JavaScript?

JavascriptWeb DevelopmentFront End Technology

JavaScript uses the var keyword to declare a namespace.To declare a namespace in JavaScript, you can try to follow the below syntax −

var myNamespace = {
   functionOne: function()
   {
   },
   functionTwo: function()
   {
   }
};
...
myNamespace. functionOne();
raja
Published on 29-Jan-2018 09:59:32
Advertisements