Is setting properties on the Window object considered bad practice?

后端 未结 3 526
暗喜
暗喜 2020-12-17 10:51

I\'m writing a quite complex JavaScript application that has an MVC architecture that I\'m implementing using Prototype\'s Class support and the Module pattern. The applicat

3条回答
  •  心在旅途
    2020-12-17 11:05

    I would say it's bad practice. You can always, and easily, create a namespace for your application and put globals in there, if you must.

提交回复
热议问题