Skip to content

Función Card Validation de María Alejandra Cabrera Pérez#55

Open
AlejandraCP wants to merge 1 commit intoLaboratoria-learning:masterfrom
AlejandraCP:master
Open

Función Card Validation de María Alejandra Cabrera Pérez#55
AlejandraCP wants to merge 1 commit intoLaboratoria-learning:masterfrom
AlejandraCP:master

Conversation

@AlejandraCP
Copy link

Hola, le mando mi código de la función para validar un número de tarjeta de crédito.
De ante mano muchas gracias por su tiempo, sus observaciones me ayudarán mucho.
Saludos.

for (var i = 0; i < numberCard.length; i++) {
// Si el elemento es igual a un string vacio aparece nuevo prompt.
// Si el elemento es NaN aparece nuevo prompt.
if (numberCard[i] === ' ' || isNaN(numberCard[i])) {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Es buen idea verificar que es un numero y esto cubre casi todos los casos, pero todavia permite "+" y "-" porque "-9" es un numero.

@cm6n cm6n removed their assignment Dec 27, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants