Skip to main content
Stack Overflow
  1. About
  2. For Teams

Timeline for How do I declare a namespace in JavaScript?

Current License: CC BY-SA 3.0

5 events
when toggle format what by license comment
May 23, 2022 at 21:29 comment added onefootswill yep. I realise that. The question was put to me by our architect, who is fighting me on the inclusion of this approach. He seems content with polluting the global namespace in the creaky, old, low quality code-base. Some people ¯_(ツ)_/¯
May 23, 2022 at 2:23 comment added ziesemer @onefootswill - What you're looking for is not applicable here, as you're not strictly declaring variables - but new properties on to existing objects.
May 22, 2022 at 22:42 comment added onefootswill This is great, but I have a question about let and const. Once you have created a namespace namespace("com.ziesemer.myApp"), is it possible to designate a property/object as const or let? Like com.ziesemer.myApp.logger - it seems to me that this can never be declared as const. I think with this I can't adopt some of those newer language features. Note: adopting the new Javascript modules is not an option unfortunately.
Nov 28, 2016 at 12:41 history edited ziesemer CC BY-SA 3.0
added 201 characters in body
Nov 28, 2016 at 0:05 history answered ziesemer CC BY-SA 3.0

AltStyle によって変換されたページ (->オリジナル) /