Question: a ) The following function returns true if you wanted to know if the character ( ch ) is an uppercase character in the alphabet.

a) The following function returns true if you wanted to know if the character (ch) is an uppercase character in the alphabet. What if you wanted it to return true for both uppercase and lowercase letters of the alphabet.
let isAlpha = function(ch){ if (ch >="A" && ch <="Z")
return true;
else
return false; };
Copy the function definition above and paste it into lab5.js.
b) Test the function in the console using the two tests shown here. Note that it only recognizes capitalized alphabetic characters. console.log(isAlpha("R")); // expect true
console.log(isAlpha("r")); // expect false
c) Now modify the function to recognize both uppercase and lowercase alphabetic characters. Dont forget to place this function in your lab5.js file. Hint: One way is to use either the String method toLowerCase() or the String method toUpperCase().

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!