Advertisement
rony2605

Verifica a palavra chave e mutiplica valor

Mar 2nd, 2013
310
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.  }
  2.  
  3.       function parseDonuts(donutString) {
  4.         numDonuts = parseInt(donutString);  //Verifica se a palavra duzia aparece nos dados digitados
  5.         if (donutString.indexOf("dozen") != -1)
  6.           numDonuts *= 12; //Mutiplica o numero por 12
  7.         return numDonuts;
  8.       }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement