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;i++){
if(this[i]==sqrt||i==this.length){
result[b]='';
//j = a = 0;
for(var j = a;j<i;j++){
result[b]+=this[j];
}
b++;
a=i+1;
}
}
return result;
}
console.log(str.mySplit(','))
Aww, I just sticking with all things around JavaScript right now. It’s really fun to sticking round with those interesting code.
I can understand this code(no really completly), but it takes a lot time! it’s there any course, or methods that can help me improve my ways to code?