Home >Web Front-end >JS Tutorial >Tool to count the occurrences of each string in jQuery_jquery

Tool to count the occurrences of each string in jQuery_jquery

WBOY
WBOYOriginal
2016-05-16 17:53:501270browse
Copy code The code is as follows:





工具:统计jQuery中各字符串出现次数



源文件(将jQuery源码复制到下面的文本域):




 

 



 

 


点击“统计所有字符出现次数”按钮后发现,字符串“string”竟然出现了44次,多数是诸如以下的代码



typeof selector === "string" <br>typeof data !== "string" <br>type === "string" <br>typeof context === "string" <br>getByName = typeof name === "string" <br>// ... <br>


  


如果使用一个变量替换,使用工具压缩时将会进一步减少文件的大小。


 


 





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