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 | Conditional Statements
Practice
Projects
Quizzes & Challenges
Quizzes
Challenges
/
Introduction to JavaScript

bookChallenge: Weather-Based Outfit Recommender

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

Everything was clear?

How can we improve it?

Thanks for your feedback!

SectionΒ 3. ChapterΒ 4
single

single

Ask AI

expand

Ask AI

ChatGPT

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

close

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Β 3. ChapterΒ 4
single

single

some-alt