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 functionch if ch A && ch Z
return true;
else
return false; ;
Copy the function definition above and paste it into labjs
b Test the function in the console using the two tests shown here. Note that it only recognizes capitalized alphabetic characters. console.logisAlphaR; expect true
console.logisAlphar; expect false
c Now modify the function to recognize both uppercase and lowercase alphabetic characters. Dont forget to place this function in your labjs 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
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
