Assign object[key] to a temp variable in a javascript “for…in” loop?

◇◆丶佛笑我妖孽 提交于 2019-11-29 12:14:49

It turns out it is indeed faster to assign your object[key] to a temporary variable in for-in loops with large objects, as seen in this jsPerf test. That way, you won't have to obtain object[key] for every property of the object.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!