How js splits a string into multiple arrays

how var arr="a,b,c" is split into [a], [b], [c]

Jan.28,2022

arr.split (',')


actually look at the operation of strings and arrays and believe you can find the method yourself.
arr.split (',') can turn the string into an array
and then traverse the array to return the single array you want


var attr1= 'Ali Technology Co., Ltd.' .split ('');

  var attr2=['','',''];
  var result=[];
       console.log(attr1)
for(var i=0;i<attr2.length;iPP){
    result.push(new Array(attr2[i]))
}

  var newArr=[];
  for(var j=0;j<result.length;jPP){
     newArr.push(result[j])
  }
  var newArr2=[];
  for(var k=0;k<newArr.length;kPP){
     newArr2.push(newArr[k].join('').split(''));
      
  }
  var _res=[];
  for(var m=0;m<newArr2.length;mPP){
       var count=0;
        for(var d=0;d<newArr2[m].length;dPP){
            for(var n=0;n<attr1.length;nPP){
                if(attr1[n]==newArr2[m][d]){
                    countPP;
                }
            }
        }
        _res.push(count)
  }
Menu