Created
January 31, 2019 15:52
-
-
Save jjvillavicencio/5aadf4bec8944632f35a0e7d23b4273d to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var fecha = new Date(); | |
var horaActual = fecha.getHours(); | |
var saludo; | |
if (horaActual > 18) { | |
saludo = 'Buenas noches, ' | |
} else if (horaActual > 12) { | |
saludo = 'Buenas tardes, ' | |
} else if (horaActual > 0) { | |
saludo = 'Buen día, ' | |
} else { | |
saludo = 'Bienvenido, ' | |
} | |
console.log(saludo); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment