Type error, cannot read property 'match' of undefined : <p>i got stuck in the Javascript code below, I don't know what's the problem.
the code is always showing"Type error, cannot read property 'match' of undefined",
Here IS THE CODE:</p>

<pre><code>function keepletteronly(str) {
     str=str.toLowerCase();//Make the string to lower case
     arr=str.split("");    //This way I make an array out of the string
     arr1=[]; //make an new array
for (i=1; i&lt;=arr.length;i++){
    if (arr[i].match(/[a-z]/)!=null) {  //This is where the problem is
        arr1.push(arr[i]); //retain only the letters and append to the arr1
    }
}
newstring=arr1.join;
return newstring;  


}



keepletteronly("1eye");
</code></pre>
