Javascript String toCharArray=function()

Description

Javascript String toCharArray=function()



String.prototype.toCharArray=function(){
 var arr=new Array();
 for(var i=0;i<this.length;i++){
//  arr[i]=this.substring(i, i+1);
  arr[i]=this.charAt(i);//  w  ww  .  j  a  v  a 2 s .  c om
//  arr[i]=this[i];
 }
 return arr;
}



PreviousNext

Related