First off, I know this is far from professional. I\'m trying to learn how to work with strings. What this app is supposed to do is take a simple text input and do a few thi
isUpperCase
and isLowerCase
are not JavaScript functions.
You can replace them with something like
var isUpperCase = function(letter) {
return letter === letter.toUpperCase();
};
var isLowerCase = function(letter) {
return letter === letter.toLowerCase();
};
There were a lot of syntax errors in your code which you need to check.
I was also getting confused with all your brackets so instead of using the charAt
I just referenced the string like an array. So instead of
text.charAt(letters)
I used
text[letters]
which I found easier to read.
See the full jsFiddle here. I modified your code slightly because jsFiddle doesn't allow document.write