//rust java等語言的實現(xiàn)
https://hltj.me/lang/2017/06/05/10m-letters-2.html
//阿龍 通過ramda實現(xiàn) 統(tǒng)計字符的個數(shù)
let fn = text => ([x,...xs]) =>x==null?null:({
[x]:R.reduce((a,b)=>a+(b==x?1:0),0,text),
...fn(text)(xs)
})
let action = text => fn(text)(text)
action("aaaaaaaaaaaalsdjfoiqweijiajefowiaaaaddddaaaabbbbbbb")
//阿龍 通過ramda實現(xiàn) 統(tǒng)計字符的個數(shù)
————————————————————————————
//輸出一次
輸出a-z 26個字母(用for循環(huán)輸出)
for(var i=0;i<26;i++){
document.write(String.fromCharCode(65+i));//輸出A-Z 26個大寫字母
}
for(var i=0;i<26;i++){
document.write(String.fromCharCode(97+i));//輸出a-z 26個小寫字母
}