Advertisement
Guest User

Untitled

a guest
Aug 22nd, 2019
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.51 KB | None | 0 0
  1. const keys = {
  2. "Coding": 10,
  3. "Mountain Biking": 10,
  4. "Hiking": 9,
  5. "Washing Dishes": 2,
  6. "Rainy Days": 0
  7. }
  8.  
  9. const options = ["Coding", "Mountain Biking", "Hiking", "Washing Dishes", "Rainy Days"]
  10.  
  11. let returnMessage = (selected) => `${selected}: ${keys[selected]} out of 10 Excitement Level.`
  12.  
  13. let num = Math.floor(Math.random() * Math.floor(4))
  14.  
  15. returnMessage(options[num])
  16.  
  17. // OUTPUT THE RESULT
  18. returnMessage(options[Math.floor(Math.random() * Math.floor(4))])
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement