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.
1
Expert's answer
2016-11-10T13:42:09-0500
function checkNumber(n) { return n.match(/^X\d{8}/)?true:false; }
Numbers and figures are an essential part of our world, necessary for almost everything we do every day. As important…
APPROVED BY CLIENTS
"assignmentexpert.com" is professional group of people in Math subjects! They did assignments in very high level of mathematical modelling in the best quality. Thanks a lot
Comments
Leave a comment