zornitza_gencheva

13_task_Digital Soothsayer_js_file

Jul 17th, 2014
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.53 KB | None | 0 0
  1. function soothsayer(arrOfNumbers, arrOfProgramingLanguages, arrOfCities, arrOfCars) {
  2. var arrOfAllArrays = [arrOfNumbers, arrOfProgramingLanguages, arrOfCities, arrOfCars];
  3. var result = [];
  4. for(var i = 0; i < 4; i++) {
  5. var currentRandom = Math.floor(Math.random() * 4) + 0;
  6. var currentArray = arrOfAllArrays[i];
  7. result[i] = currentArray[currentRandom];
  8. }
  9. console.log("You will work " + result[0] + " years on " + result[1] + ". You will live in " + result[2] + " and drive " + result[3]);
  10. }
Advertisement
Add Comment
Please, Sign In to add comment