Blogger Information
Blog 26
fans 0
comment 0
visits 21508
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
一组字符串出现了几次
default
Original
573 people have browsed it
  1. var str = 'jiksadsiadhiaosfdhasldp'
  2. var obj={}
  3. for(var i =0;i<str.length;i++){
  4. // console.log(str[i])
  5. var chars = str.charAt(i)
  6. if(obj[chars]){
  7. obj[chars] ++
  8. }else{
  9. obj[chars] = 1
  10. }
  11. }
  12. console.log(obj)
Statement of this Website
The copyright of this blog article belongs to the blogger. Please specify the address when reprinting! If there is any infringement or violation of the law, please contact admin@php.cn Report processing!
All comments Speak rationally on civilized internet, please comply with News Comment Service Agreement
0 comments
Author's latest blog post