Home >Web Front-end >JS Tutorial >JQuery for and each performance comparison analysis_jquery

JQuery for and each performance comparison analysis_jquery

WBOY
WBOYOriginal
2016-05-16 17:33:431077browse

Recently I have been working on performance optimization and encountered many detailed problems. Now I will record the problems encountered one by one and share them with everyone. No thanks for the nonsense. I will post the code directly.

Copy code The code is as follows:



Performance comparison between for and each


< /head>








Input difference:
for loop execution time: 1
Each loop execution time: 3
The two results directly illustrate the problem.
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn