-
Notifications
You must be signed in to change notification settings - Fork 116
Cifrado Cesár - Laura Jiménez #78
base: master
Are you sure you want to change the base?
Conversation
|
@developerVilchez eslint OK |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
¡Gran trabajo! Solo tengo algunos pequeños comentarios.
js/app.js
Outdated
| } | ||
|
|
||
| // Por medio de 'prompt' le pedimos al usuario que ingrese un frase: | ||
| var order = (prompt('INGRESE UNA FRASE: ')); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Las () no son necesarios, puedes escribir:
var order = prompt('INGRESE UNA FRASE: ');
js/app.js
Outdated
| } | ||
|
|
||
| // Por medio de 'prompt' le pedimos al usuario que ingrese un frase: | ||
| var order = (prompt('INGRESE UNA FRASE: ')); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
¿Por qué esta variable se llama order? Un nombre como phrase me parece mejor.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Porque ya había utilizado ese nombre mas arriba y pensé que ya no podía utilizarlo, mejorare el nombre de mis variables gracias. :)
| } | ||
|
|
||
| // Mensaje si ha ingresado espacios: | ||
| if (spaces === true) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
=== true no es necesario. Puedes escribir solo:
if (spaces)
js/app.js
Outdated
| for (var re = 0; re < order.length; re++) { | ||
| // Condicional para que no se pueda ingresar numeros: | ||
| if (order.charCodeAt(re) >= 65 && order.charCodeAt(re) <= 90 || order.charCodeAt(re) > 96 && order.charCodeAt(re) < 123) { | ||
| var value = true; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Esta variable puede tener un nombre más descriptiva.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Por ejemplo, algo como stringContainsOnlyLetters.
js/app.js
Outdated
| } | ||
|
|
||
| // Condicional si ha ingresado solo letras sin numeros: | ||
| if (value === true) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if (value)
js/app.js
Outdated
| } | ||
|
|
||
| // Mensaje si ha ingresado numeros: | ||
| if (value === false) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if (!value)
|
Gracias por el feedback, lo tomare muy en cuenta para proximos proyectos. |
Hola,
Gracias por revisar mi código y darme feedback, disculpen si tengo muchos errores.