0
lesson 22.1 switch
Hi, can you please tell my, how code should look like to work with this switch formula? I've just started to learn JS and have no IT background at all... function main() { var day_of_week = parseInt(readLine(), 10); switch (day_of_week) { case 1: case 2: case 3: case 4: case 5: document.write("Working Days"); break case 6: document.write("Saturday"); break default: document.write("Today is Sunday"); break; } console.log(1);
2 Antworten
+ 4
Is this a code practice or you're just trying?
Can you elaborate more on that please?