var alphabet =['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z']; for(var i = 0; i<= alphabet.length; i++) { alphabet[i] = alphabet[i].toLowerCase(); }
Mistake:
Uncaught TypeError: Cannot read property toLowerCase of undefined.
Why is alphabet [i] - undefined ?
<
instead of<=
- Grundy