Skip to content

Instantly share code, notes, and snippets.

@fabioperrella
Created April 19, 2022 20:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save fabioperrella/d8fa2088653d30694b120a5b9cc77277 to your computer and use it in GitHub Desktop.
Save fabioperrella/d8fa2088653d30694b120a5b9cc77277 to your computer and use it in GitHub Desktop.
suzana
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