[removed] final / immutable global variables?

前端 未结 14 2101
既然无缘
既然无缘 2020-12-13 09:03

I think I know the answer but... is there any way to prevent a global variable from being modified by later-executing

14条回答
  •  忘掉有多难
    2020-12-13 09:34

    I know this question is old, but you could use Object.freeze(yourGlobalObjectHere); I just wrote a blog post about it here.

提交回复
热议问题