Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Lära Challenge: Day of the Week Condition Execution | Section
Practice
Projects
Quizzes & Challenges
Quizzes
Challenges
/
Essential TypeScript Basics for JavaScript Developers - 1768407373799

bookChallenge: Day of the Week Condition Execution

Your first big TypeScript task!

There are 7 days in a week.

  • Everyone loves Friday and the weekends, and no one likes Monday;
  • I've written code blocks for you that will execute under certain conditions;
  • Your task is to write code that will check the condition of what day of the week it is today. If today is Monday, the first code block with the condition is executed. If it's Friday, the second block is executed, and so on. Implement this code by replacing the blanks(___) with your code;
  • You can use the hint and solution buttons if you have trouble understanding the code;
  • Don't hesitate to look at and analyze the solution; it will help you understand the correctness of your code.
123456789101112
let today: string = 'Friday' if (___) { ___("Oh, it's Monday.. again"); } else if (___) { ___("It's Friday my dudes!"); } else if (___) { ___("I can sleep all day!"); } else if (___) { ___("The last day of weekends"); } else { ___("Waiting for the weekends..") }
copy

Var allt tydligt?

Hur kan vi förbättra det?

Tack för dina kommentarer!

Avsnitt 1. Kapitel 11

Fråga AI

expand

Fråga AI

ChatGPT

Fråga vad du vill eller prova någon av de föreslagna frågorna för att starta vårt samtal

bookChallenge: Day of the Week Condition Execution

Svep för att visa menyn

Your first big TypeScript task!

There are 7 days in a week.

  • Everyone loves Friday and the weekends, and no one likes Monday;
  • I've written code blocks for you that will execute under certain conditions;
  • Your task is to write code that will check the condition of what day of the week it is today. If today is Monday, the first code block with the condition is executed. If it's Friday, the second block is executed, and so on. Implement this code by replacing the blanks(___) with your code;
  • You can use the hint and solution buttons if you have trouble understanding the code;
  • Don't hesitate to look at and analyze the solution; it will help you understand the correctness of your code.
123456789101112
let today: string = 'Friday' if (___) { ___("Oh, it's Monday.. again"); } else if (___) { ___("It's Friday my dudes!"); } else if (___) { ___("I can sleep all day!"); } else if (___) { ___("The last day of weekends"); } else { ___("Waiting for the weekends..") }
copy

Var allt tydligt?

Hur kan vi förbättra det?

Tack för dina kommentarer!

Avsnitt 1. Kapitel 11
some-alt