1. The foundation is very poor, want to find a string of code, or analysis tools to help you understand.
as follows:
var str = "i,am,cool,i,love,wz";
String.prototype.mySplit = function(sqrt){
var result = [];
var a = 0;
var b = 0;
console.log(this.length)
for(var i = 0;i<this.length;iPP){
if(this[i]==sqrt||i==this.length){
result[b]="";
//j = a = 0;
for(var j = a;j<i;jPP){
result[b]+=this[j];
}
bPP;
a=i+1;
}
}
return result;
}
console.log(str.mySplit(","))
I always feel that I don"t understand this kind of nested code thoroughly!-sharp-sharp-sharp topic description
sources of topics and their own ideas
related codes
/ / Please paste the code text below (do not replace the code with pictures)