Advertisement
vinissh

dowhileJS

Feb 20th, 2020
202
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function getInteiroAleatorioEntre(min, max) {
  2.     var valor = Math.random() * (max - min) + min;
  3.     return Math.floor(valor);
  4. }
  5.  
  6. var opcao = 0;
  7.  
  8. do {
  9.     opcao = getInteiroAleatorioEntre(-1, 10);
  10.     console.log('Opção valida escolhida foi', opcao);
  11. } while (opcao != -1)
  12.  
  13. console.log('Até a próxima !');
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement