Are there any drawbacks to using anonymous functions in JavaScript? E.g. memory use?

后端 未结 3 1020
北海茫月
北海茫月 2021-02-01 15:16

At some point in the past, I read something that gave me the idea that anonymous functions in JavaScript can use up a surprising amount of memory (because they carry th

3条回答
  •  一个人的身影
    2021-02-01 15:40

    This is true, due to closures that are created. as a general rule the biggest issue with the practice is performance concerns with IE (especially older versions of IE), which has a terrible track record of dealing with these properly.

提交回复
热议问题