Uncaught TypeError: Cannot read property ‘toUpperCase’ of undefined

Try this:

var getusername= ""+usernames[k];

If that doesn’t work, then this could be the problem:

Switch

for (var k = 0; k <= usernames.length; k++)

for

for (var k = 0; k <= usernames.length-1; k++)

Leave a Comment