Defines why objects can use arrays

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)]

Mar.09,2021

json [] is the form of Object attribute access, and the array is also Object .

let json = { 'a': 1 };
console.log(json['a']);
let array = [];
console.log(array['length'])

how about comparing this?

var obj = {
    a: 1,
    1: 'b'
}
obj.a
obj['a']
obj.1
obj[1]
MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b35c89-2b50b.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b35c89-2b50b.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?