Published on January 26, 2024By DeveloperBreeze
function isValidCreditCardNumber(cardNumber) {
const regex = /^[0-9]{13,16}$/;
return regex.test(cardNumber);
}
const cardNumber = '1234567890123456';
console.log('Is Valid Credit Card Number:', isValidCreditCardNumber(cardNumber));
Comments
Please log in to leave a comment.