Global variables (again)

前端 未结 11 1061
感情败类
感情败类 2021-01-21 16:31

I keep hearing that global variables should never be used, but I have a tendency to dismiss \"never\" rules as hot-headed. Ar

11条回答
  •  轮回少年
    2021-01-21 16:34

    I'm also curious to hear the precise explanation, but I can tell you that the Singleton pattern usually works pretty well to fill the role of global variables.

提交回复
热议问题