const res={}
["s","s","a"].forEach((key)=>{
if(res[key]){
res[key]++
}else{
res[key]=1
}
})
console.log(res)