Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Learn Challenge: Weather-Based Outfit Recommender | Section
JavaScript Fundamentals
SectionΒ 1. ChapterΒ 32
single

single

bookChallenge: Weather-Based Outfit Recommender

Swipe to show menu

Task

Swipe to start coding

Write a program that suggests what to wear based on weather conditions. Use if-statements to check the weather and display an outfit recommendation.

Recommendations:

  • If the weather is "sunny", display: "Wear sunglasses and a t-shirt!"
  • If the weather is "rainy", display: "Take an umbrella and wear a raincoat!"
  • If the weather is "cold", display: "Wear a warm jacket and a scarf!"

Use strict equality checks (===) in your conditions.

Solution

Switch to desktopSwitch to desktop for real-world practiceContinue from where you are using one of the options below
Everything was clear?

How can we improve it?

Thanks for your feedback!

SectionΒ 1. ChapterΒ 32
single

single

Ask AI

expand

Ask AI

ChatGPT

Ask anything or try one of the suggested questions to begin our chat

some-alt