Question
We want to examine the input we read. If the value is wrong, an exception (err) is thrown. The exception (err) is caught by the
We want to examine the input we read. If the value is wrong, an exception (err) is thrown. The exception (err) is caught by the catch statement and a custom error message is displayed according to:
a- If the value entered is a number throw 'not a character" b- if the value read smaller than e return 'smaller than e'. c- if the value read greater than m return 'greater than m'.
Replace a-,b-,c- with the below statements.
Please input a letter between 'e' and 'm':
Which options are correct?
if(!isNaN(x)) throw "not a character";
if(x < 'd') throw "too low";
if(x > 'm') throw "too high";
if(isNaN(x)) throw "not a character";
if(x > 'd') throw "too low";
if(x < 'm') throw "too high"
if(!Number(x)) throw "not a character";
if(x > 'd') throw "too low";
if(x < 'm') throw "too high";
if(Number(x)) throw "not a character";
if(x < 'd') throw "too low";
if(x > 'm') throw "too high";
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started