Facebook
From Mustard Hedgehog, 3 Years ago, written in Plain Text.
Embed
Download Paste or View Raw
Hits: 37
  1. function demo (input){
  2.  
  3. let degrees = Number (input[0]);
  4. let timeOfDay = input[1];
  5. let outfit
  6. let shoes
  7.  
  8. if (degrees <=10 && degrees <=18){
  9.     if (timeOfDay === "Morning"){
  10.          outfit = "Sweatshirt"
  11.          shoes = "Sneakers"
  12.     }
  13.     else if (timeOfDay === "Afternoon" || timeOfDay === "Evening"){
  14.         outfit = "Shirt"
  15.         shoes = "Moccasins"
  16.     }
  17. }
  18. console.log(`"It's ${degrees} degrees, get your ${outfit} and ${shoes}."`);
  19.  
  20. }
  21. demo(["16","Morning"])