72 532
Assignments Done
Successfully Done
In April 2019

Answer to Question #63155 in AJAX | JavaScript | HTML | PHP for Miguel Rivera

Question #63155
Write a function that takes in one argument. The function should return true if the passed in argument is a valid X Number. A valid X number is 9 characters in length, begins with a X and ends with 8 digits. The function should return false if it is not valid X Number.
Call the function 4 times, 2 times with valid X Numbers and 2 times with invalid X Numbers and display the results.
Expert's answer
function checkNumber(n) {
return n.match(/^X\d{8}/)?true:false;


Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!


No comments. Be first!

Leave a comment

Ask Your question

Privacy policy Terms and Conditions