Does JavaScript (ECMAScript5) Strict Mode offer significant performance advantages to merit widespread use?

后端 未结 3 616
一个人的身影
一个人的身影 2021-02-07 20:07

I\'m reading up a bit on using Strict Mode for JavaScript and it seems that, generally speaking, the idea is to force a more rigid set of rules onto the coder to ensure that the

3条回答
  •  野趣味
    野趣味 (楼主)
    2021-02-07 20:54

    I think the reasons to use it were spelled out well by John Resig, http://ejohn.org/blog/ecmascript-5-strict-mode-json-and-more/, and it appears Firefox will be supporting it, http://whereswalden.com/2010/09/08/new-es5-strict-mode-support-now-with-poison-pills/, so it may be useful to look at, at least for libraries.

    But, basically, it is to help prevent some common programming errors, but for some people losing the eval may be reason not to use it, and for me not having unnamed anonymous functions will be difficult, but, anything that can help reduce errors may be worthwhile.

提交回复
热议问题