Created
April 19, 2022 20:10
-
-
Save fabioperrella/d8fa2088653d30694b120a5b9cc77277 to your computer and use it in GitHub Desktop.
suzana
This file contains hidden or 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
mes = 2; | |
isValidMonth = true; | |
if(mes < 1){ | |
console.log('mes tem que ser maior que 1'); | |
isValidMonth = false; | |
} | |
if(mes > 12){ | |
console.log('mes tem que ser menor que 12'); | |
isValidMonth = false; | |
} | |
if(isValidMonth == true){ | |
mesesCom31Dias = [1, 3, 5, 7, 8] | |
mesesComMenosDias = [2, 4, 6, 9, 11] | |
if(mesesCom31Dias.includes(mes)){ | |
console.log('sim'); | |
} | |
if(mesesComMenosDias.includes(mes)){ | |
console.log('nao'); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment