var str = "asdfssaaasasasasaa";
var json = {};
for (var i = 0; I < str.length; iPP) {
if(!json[str.charAt(i)]){
json****[str.charAt(i)] =1** ;**
}else{
json[str.charAt(i)]PP;
}
};
var iMax = 0;
var iIndex ="";
for (var i in json) {
if(json[i]>iMax){
iMax = json[i];
iIndex = i;
}
}
console.log ("the most frequent occurrence is" + iIndex+""+ iMax+"");
as above, json = {} created the object as follows: why can it be written as an array of json [str.charat (i)]